W
wheels619
Hi,
I have a quick reg ex question. I'm trying to do a search and replace
on:
4in'>1.
with
4in'><a name='1'></a>1.
I'm using this regex:
s/4in'>[0-9]+\./<a name='$1'><\/a>$1\./g
I thought that the $1 would match the first match in the brackets, in
this case, the 1. However, it just says not initialized value.
Any ideas what special Perl variable to use?
I tried $+ but same error. $& contains entire match, not just the
number.
thanks!
I have a quick reg ex question. I'm trying to do a search and replace
on:
4in'>1.
with
4in'><a name='1'></a>1.
I'm using this regex:
s/4in'>[0-9]+\./<a name='$1'><\/a>$1\./g
I thought that the $1 would match the first match in the brackets, in
this case, the 1. However, it just says not initialized value.
Any ideas what special Perl variable to use?
I tried $+ but same error. $& contains entire match, not just the
number.
thanks!