You want to match "foo\nbar", using the /m modifier to a regex.
and$string = "...foo\nbar..."; if ($string =~ /foo$bar/m) { # ... }
How successful are you? Also consider$string = "...foo\nbar..."; if ($string =~ /foo$^bar/m) { # ... }
Now how successful are you? Please explain your answers, and give any insight you have into the cause of the problem.$string = "...foo\nbar..."; if ($string =~ / foo$ ^bar /mx) { # ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Regex Quiz) Multi-line Matching
by Albannach (Monsignor) on May 22, 2001 at 23:51 UTC | |
by nysus (Parson) on May 22, 2001 at 23:54 UTC | |
by japhy (Canon) on May 23, 2001 at 00:54 UTC | |
|
(tye)Re: (Regex Quiz) Multi-line Matching
by tye (Sage) on May 22, 2001 at 22:12 UTC | |
|
Re: (Regex Quiz) Multi-line Matching
by nysus (Parson) on May 22, 2001 at 23:38 UTC | |
|
Re: (Regex Quiz) Multi-line Matching
by nysus (Parson) on May 22, 2001 at 23:20 UTC | |
by japhy (Canon) on May 22, 2001 at 23:24 UTC |