in reply to (wil) Re: regex: extract a substring
in thread regex: extract a substring
Do keep in mind that wil's example will make foo equal to the characters between abc and xyz. i.e. $foo == "hello"
if you are trying to extract to another variable you need to do something more like this.
the value of $foo is unchanged. ---Mogaka is good
$foo = "abchelloxyz"; $foo =~ /abc([\w]+)xyz/; $bar = $1;
the value of $foo is unchanged. ---Mogaka is good
|
---|
Replies are listed 'Best First'. | |
---|---|
Re3: regex: extract a substring
by Hofmator (Curate) on May 24, 2002 at 17:07 UTC | |
Re: Re: (wil) Re: regex: extract a substring
by insensate (Hermit) on May 23, 2002 at 23:12 UTC |
In Section
Seekers of Perl Wisdom