Skip to content

Commit

Permalink
[C#][netcore] fix regular expression when it contains double quotes (#…
Browse files Browse the repository at this point in the history
…7147)

* escape special characters in regular expression in csharp netcore client

* escape double quote
  • Loading branch information
wing328 authored Aug 7, 2020
1 parent 4811785 commit 5abf8b8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public void postProcessPattern(String pattern, Map<String, Object> vendorExtensi
+ "/pattern/modifiers convention. " + pattern + " is not valid.");
}

String regex = pattern.substring(1, i).replace("'", "\'");
String regex = pattern.substring(1, i).replace("'", "\'").replace("\"", "\"\"");
List<String> modifiers = new ArrayList<String>();

// perl requires an explicit modifier to be culture specific and .NET is the reverse.
Expand Down

0 comments on commit 5abf8b8

Please sign in to comment.