The \Q is mostly precautionary, in case $badword might have a regex-special char in it.while ($sth->fetch) { $username =~ s/\b\Q$badword\b/ **** /gi or print "[$badword] not found in $username\n"; $message =~ s/\b\Q$badword\b/ **** /gi or print "[$badword] not found in $message\n"; }
In reply to Re^5: s/// not replacing data
by Roy Johnson
in thread s/// not replacing data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |