Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have the following expression :
I was thinking about rewriting it to be a bit shorter and therefore easier to follow and so I tried this $vacation_str =~ s/(v??a??c??a??t??i??o??n??\.??m??s??g??)//; however it does not match anything within the real program. My test one works, but the live edition does not.$vacation_str =~ s/((msg|vacation.msg)|a(cation.msg|t(ation.msg|ition +.msg))|catation.msg|g|i(on.msg|tion.msg)|msg|n.msg|on.msg|sg|t(ation. +msg|i(on.msg|tion.msg))|vacation.msg)//;
Thanks for looking this over
Jack
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rewrite a Regular Expression to be easier to understand
by Corion (Patriarch) on Mar 04, 2004 at 20:19 UTC | |
|
Re: Rewrite a Regular Expression to be easier to understand
by kvale (Monsignor) on Mar 04, 2004 at 20:13 UTC | |
|
Re: Rewrite a Regular Expression to be easier to understand
by Roy Johnson (Monsignor) on Mar 04, 2004 at 22:08 UTC | |
|
Re: Rewrite a Regular Expression to be easier to understand
by ambrus (Abbot) on Mar 04, 2004 at 20:55 UTC |