in reply to A tidier regex ?
Would you consider this 'better'
$s =~ m[CDC(?:_[A-Z0-9]+){2}(?:,\s+DDC[A-Z0-9]+){2}] and print 'Matche +d';;
The question is, do you need to be quite so specific?
That is, if you reduced the regex to say: m[CDC\w+(?:,\s+\w+){2}], is there the possibility that it could falsely match something else that will appear somewhere in the file?
It's obviously not so thorough, but it may be good enough given your knowledge of what will be in the file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A tidier regex ?
by dasgar (Priest) on Sep 14, 2010 at 13:24 UTC | |
by Anonymous Monk on Sep 14, 2010 at 13:43 UTC | |
|
Re^2: A tidier regex ?
by Anonymous Monk on Sep 14, 2010 at 13:32 UTC | |
by BrowserUk (Patriarch) on Sep 14, 2010 at 13:50 UTC |