This commit is contained in:
rolux 2012-05-27 18:41:14 +02:00
parent f3b0bb6c86
commit a811f29837

View file

@ -2,6 +2,10 @@
Ox.escapeRegExp <f> Escapes a string for use in a regular expression Ox.escapeRegExp <f> Escapes a string for use in a regular expression
(str) -> <r> Escaped string (str) -> <r> Escaped string
str <s> String str <s> String
> Ox.escapeRegExp('foo.com/bar?baz')
'foo\\.com\\/bar\\?baz'
> new RegExp(Ox.escapeRegExp('foo.com/bar?baz')).test('foo.com/bar?baz')
true
@*/ @*/
// see https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions // see https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions
Ox.escapeRegExp = function(string) { Ox.escapeRegExp = function(string) {