Chromium Code Reviews| Index: Source/core/html/BaseTextInputType.cpp |
| diff --git a/Source/core/html/BaseTextInputType.cpp b/Source/core/html/BaseTextInputType.cpp |
| index 9a9540f70035465b5eab3d57c83b1dd8526df30b..fd9c9e5b748ad7c458ac641039637b4bacb9c57b 100644 |
| --- a/Source/core/html/BaseTextInputType.cpp |
| +++ b/Source/core/html/BaseTextInputType.cpp |
| @@ -44,9 +44,12 @@ bool BaseTextInputType::patternMismatch(const String& value) const |
| if (rawPattern.isNull() || value.isEmpty()) |
| return false; |
| String pattern = "^(" + rawPattern + ")$"; |
| + RegularExpression regex(pattern, TextCaseSensitive); |
| + if (!regex.isValid()) |
|
adamk
2013/04/22 17:48:03
There are other uses of RegularExpression; is ther
|
| + return false; |
| int matchLength = 0; |
| int valueLength = value.length(); |
| - int matchOffset = RegularExpression(pattern, TextCaseSensitive).match(value, 0, &matchLength); |
| + int matchOffset = regex.match(value, 0, &matchLength); |
| return matchOffset || matchLength != valueLength; |
| } |