use strict; use warnings; my $a=' $text=~s#Find \#Text#Replace Text#; $text=~s/Find \/Text/Replace Text/; $text=~s{Find \}Text}{Replace Text}; '; if ($a =~ / # start \$text=~s # remember to escape the $ to avoid interpolation (.) # capture the '#' (.*?) # match any non-newline character non-greedily (?<!\\) # make sure the '#' is not escaped in your data \1 # the first unescaped '#' (.*?) # match any non-newline character non-greedily \1; # the second '#' /x # end ) { # need value $findtext='Find \#Text'; print "$2\n"; # need value $repltext='Replace Text'; print "$3\n" }
In reply to Re: Regexp help!!
by inman
in thread Regexp help!!
by kanish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |