john_costa has asked for the wisdom of the Perl Monks concerning the following question:
Hi , i am working with regular expression and got into trouble how to differentiate between two patterns
the above rule of labelname will accept anything. now i want to have another ruleLETTER [A-Za-z] DIGIT [0-9] LABELNAME {LETTER}(_|{LETTER}|{DIGIT})*
if i use first one i need to do further coding to get value of reg_num numerical value that why i want to use second one. problem is second rule fits in 1 rule also and so i get error results. is there any way i can have differen rules for second case and just able to have recognized patterns like p0 , P2 from second rule so that i dont need to do extra calculation to extract values as would have been in first case. ThanksREGNAME [pP] REG_NUM [0-9]+
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help related to regular expression
by lidden (Curate) on Mar 04, 2010 at 07:56 UTC |