Also added the caret symbol, for completeness. In this way all ascii symbols are allowed.

This commit is contained in:
Kasper Peulen 2013-11-28 00:00:02 +01:00
parent a7cb139238
commit af2d854be5

View File

@ -335,7 +335,7 @@
// __foo__ is reserved and not a pattern
if ( i.match( /^__.*__$/) )
continue;
var l = i.replace( /([\\.*+?|()\[\]${}])/g, "\\$1" )
var l = i.replace( /([\\.*+?^$|()\[\]{}])/g, "\\$1" )
.replace( /\n/, "\\n" );
patterns.push( i.length === 1 ? l : "(?:" + l + ")" );
}