go ahead... be a heretic | |
PerlMonks |
Regex letter order matchingby cspctec (Sexton) |
on Mar 25, 2014 at 22:14 UTC ( [id://1079743]=perlquestion: print w/replies, xml ) | Need Help?? |
cspctec has asked for the wisdom of the Perl Monks concerning the following question:
I need to create a regex that matches a string like this:
odm_trs84t1cb1 But does not match this (only match when 'cb' is together):odm_trs84t1b01 So far, I have created this regex:[A-Za-z_-]+\d{1,3}[lt]\d[bcfmrtw]+\d+ But it matches both strings. I have been investigating positive lookbehind, but I haven't gotten it to work on regexpal.comI would appreciate some help Thanks for the help everyone... this regex seems to work: [A-Za-z_-]+\d{1,3}[lt]\d(cb|m)\d+
Back to
Seekers of Perl Wisdom
|
|