in reply to regexp in win32
with(\s*) }xm
The 'm' switch has no effect in that regexp, but it doesn't hurt either.\s* (.*) }xm
Update: Does your input span two lines? I couldn't tell before Corion added <code> tags. If so, you'll need something like:
while (<>) { my @fields; if (@fields = m{ \[ (\w{3}) \s* (\w{3}) \s* (\d{2}) \s* (\d{2}:\d{2}:\d{2})\s* (\d{4}) \] (\w*) \/ (\w*) /// Info(\(\d*\)) }xm) { push(@fields, scalar <>); print(join("\n", @fields)); } }
Update: Fixed error in join.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regexp in win32
by lorn (Monk) on Nov 16, 2005 at 19:02 UTC | |
by ptum (Priest) on Nov 16, 2005 at 19:08 UTC | |
by ikegami (Patriarch) on Nov 16, 2005 at 19:23 UTC |