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\\([^\\]+)\\/;
In reply to Re: Regexpresions
by ozone
in thread Regexpresions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |