Re: the only difference is the 'x' after '/g'
- From: "DJ Stunks" <DJStunks@xxxxxxxxx>
- Date: 30 Mar 2006 15:38:00 -0800
Tom Arnall wrote:
the following code:
my (@main);
$_="
From a
From: b
From: c
From: d
";
@main = /From [^\n]*?\n.*?(From: .*?\n).*?/gx;
print "@main";
print "------------------------------\n";
@main = /From [^\n]*?\n.*?(From: .*?\n).*?/g;
print "@main";
produces:
From: b
From: d
------------------------------
From: b
the only difference between the two regex lines is the 'x' after '/g' in the
first of the two regex lines.
those crazy modifiers -- always modifying something!
but I digress. Question, please?
-jp
.
- References:
- the only difference is the 'x' after '/g'
- From: Tom Arnall
- the only difference is the 'x' after '/g'
- Prev by Date: Re: store Array in hash ?
- Next by Date: grep file file handle
- Previous by thread: Re: the only difference is the 'x' after '/g'
- Next by thread: Win32::GUI Question
- Index(es):
Relevant Pages
|
|