[1685540 views]

[]

Odi's astoundingly incomplete notes

New entries | Code

The missing piece

I just discovered that there is a new function included in JDK 1.5 that I have been missing for several years in other languages. The function quoteReplacement of the Matcher class escapes a String suitable for litteral inclusion in a regular expression. This function is absolutely necessary if one wants to create a regular expression dynamically from possibly untrusted (user) input. I have not seen such a function in PERL (why does PERL not have an official website, BTW?), JavaScript or PHP yet.

posted on 2005-11-01 14:15 UTC in Code | 0 comments | permalink