Conal has asked for the wisdom of the Perl Monks concerning the following question:
http://rafb.net/p/38TDqL58.html
(the data isnt always as clean as this)
i am trying to write a regex to match a line when an exact pattern appears on a line.
to summarise , the patterns i am trying to match is:
(possible white space)EUR/USD(possible white space),(possible white space)X.XXXXX(possible whitespace),(possible whitespace)XX:XX:XX:XX(possible white space/random characters)(end of line)
where X is a number.
I have played around with a few things but just cant work it out.
doesnt seem to work.if ( m{^\s* EUR[/]USD \s*,s\* (\d\.\d{5}) \s*,\s* (\d\d:\d\d:\d\d) \s* + (.*) $ }x ) { // do stuff
can anyone please offer some help? thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: a little REGEX help
by CountZero (Bishop) on Mar 21, 2009 at 23:34 UTC | |
|
Re: a little REGEX help
by linuxer (Curate) on Mar 21, 2009 at 23:28 UTC | |
|
Re: a little REGEX help
by bichonfrise74 (Vicar) on Mar 22, 2009 at 02:41 UTC | |
|
Re: a little REGEX help
by targetsmart (Curate) on Mar 22, 2009 at 10:55 UTC | |
|
Re: a little REGEX help
by juster (Friar) on Mar 22, 2009 at 21:45 UTC | |
by Zen (Deacon) on Mar 23, 2009 at 15:23 UTC | |
|
Re: a little REGEX help
by Anonymous Monk on Mar 23, 2009 at 16:53 UTC | |
by linuxer (Curate) on Mar 23, 2009 at 23:10 UTC |