The "\Q" puts backslashes in front of all the special characters in '$complete'. This will make the regex treat them literally instead of a as metacharacters.$source =~ s/\Q$complete\E/<a href='$url'>$title<\/a>/g || print "
In reply to Re: replacing variable in regex - probs with special chars?
by fletcher_the_dog
in thread replacing variable in regex - probs with special chars?
by Emanuel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |