[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] regex fun...



/(\d*)d(.\d*)?(\(\d*\))?/
I'm matching a string like "3d+2(5)" and parsing out to get {3,+2,5}. The "3d" has to be there the "+2" will most likely be there but can be left out. it could also be something like "-2". the "(5)" is also optional.
But basically what the problem is, is that with the above regexp "3d(5)" will give me {3,(5,} instead of {3,,5}. I'm wondering how I can give $3 matching presedance over $2? Any other bright ideas that may help will of course be accepted :)

le meas,
--Nick
# ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org