Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I seek your wisdom: I write this very often when parsing files line-by-line ("if this line looks like this, it's this kind of data, elsif this line looks like this, it's this other kind of data, etc.") so I was wondering if there is a shorthand for the regex /^\s*abc\s*$/, or "the only thing on this line is the letters abc with maybe some whitespace"? I know I can trim the whitespace off first, but maybe there is a way to get rid of the ^$ too?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Shorthand for /^\s*abc\s*$/ ?
by Athanasius (Archbishop) on Oct 11, 2015 at 13:13 UTC | |
|
Re: Shorthand for /^\s*abc\s*$/ ?
by AppleFritter (Vicar) on Oct 11, 2015 at 13:05 UTC | |
by Laurent_R (Canon) on Oct 11, 2015 at 16:38 UTC | |
|
Re: Shorthand for /^\s*abc\s*$/ ?
by Anonymous Monk on Oct 11, 2015 at 15:30 UTC |