Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$str = "this\nis my short\nstring\n"; $regex = "my"; if ($str =~ /(.*$regex.*/) { print "Matched Line $1\n" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiline Regex
by ikegami (Patriarch) on Oct 09, 2008 at 09:41 UTC | |
by Anonymous Monk on Oct 09, 2008 at 11:01 UTC | |
by ikegami (Patriarch) on Oct 09, 2008 at 11:02 UTC | |
|
Re: Multiline Regex
by moritz (Cardinal) on Oct 09, 2008 at 09:37 UTC | |
by ikegami (Patriarch) on Oct 09, 2008 at 09:53 UTC | |
by johngg (Canon) on Oct 09, 2008 at 10:43 UTC | |
by moritz (Cardinal) on Oct 09, 2008 at 09:56 UTC | |
by ikegami (Patriarch) on Oct 09, 2008 at 10:02 UTC | |
by moritz (Cardinal) on Oct 09, 2008 at 10:24 UTC | |
| |
|
Re: Multiline Regex
by jwkrahn (Abbot) on Oct 09, 2008 at 09:41 UTC |