Hi, I want to search paragraphs tagged <FN1>...</FN1> and place it in a place instead of the indicator <FN1REF>. Generally <FN1>...</FN1> appears at the end of the file and <FN1REF> appears somewhere in the middle of the file. When I use the pattern:
$_ =~ /<FN1>([^<].+)<\/FN1>/;
$_ =~ s/<FN1ref>/<FN1>$1<\/FN1>/g;
Only <FN1></FN1> is placed in the place of the indicator. $1 does not seem to work in the replacement. Can anyone help with the correct syntax?
In reply to Find and replace using regex by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |