in reply to Regexpresions
the first regex is going to look for a single character between '\' and '\', which is not quite what you want... this is because of the '?' quantifier after the '.'. '?' means one or more.
the second one should only produce a single character - the first char of 'some text'... the '[^\\]' has an implicit quantifier of match one char only or no match at all
you will need something like this to capture the whole string (Note the '+'):
$var =~ /n\\([^\\]+)\\/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Regexpresions
by Sifmole (Chaplain) on Aug 20, 2001 at 16:48 UTC | |
by ozone (Friar) on Aug 22, 2001 at 14:13 UTC | |
by Anonymous Monk on Aug 21, 2001 at 18:14 UTC |
In Section
Seekers of Perl Wisdom