Re: Escape regex harmful characters

2003-12-30 Thread R. Joseph Newton
Steve Grazzini wrote: > On Dec 30, 2003, at 12:30 PM, Randy W. Sims wrote: > > If you have a string that is going to need escaping, consider > > using /\Q$string\U/ to handle quoting regex special chars. > > Right -- but that should be \E (for "end") instead of \U (the > mnemonic for which is "upp

Re: Escape regex harmful characters

2003-12-30 Thread Steve Grazzini
On Dec 30, 2003, at 12:30 PM, Randy W. Sims wrote: If you have a string that is going to need escaping, consider using /\Q$string\U/ to handle quoting regex special chars. Right -- but that should be \E (for "end") instead of \U (the mnemonic for which is "uppercase", not "unquote"). % perl -le

Re: Escape regex harmful characters

2003-12-30 Thread Randy W. Sims
On 12/30/2003 12:22 PM, Kevin Old wrote: Hello everyone, I found the subroutine below from a script that takes a string of text and builds a regular expression out of it and incorporates that into a rule for SpamAssassin. It's worked quite well for my needs, but the script has led to a few quest

Escape regex harmful characters

2003-12-30 Thread Kevin Old
Hello everyone, I found the subroutine below from a script that takes a string of text and builds a regular expression out of it and incorporates that into a rule for SpamAssassin. It's worked quite well for my needs, but the script has led to a few questions about the code and regex's. My quest