You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm looking at Patterns to try and pass strings that contain small chunks of source code. I'm trying to work out if I can get it to pass a string that looks like this:
x = "abc"
The part I'm troubled with is the string declaration and I'm not sure if Patterns can handle a pattern where I need a double quote following by any number of characters and ending with a second double quote.
The value "abc" seems pretty straight forwards. But what if it contains a double quote. i.e "a\"bc".
The text was updated successfully, but these errors were encountered:
A typical way you approach this problem (for nearly every parsing system) is to define a quoted string as consisting of a zero or more runs where each run is either
One or more characters other than " or \\
An escape sequence where you explicitly enumerate the escaped characters you accept, including \"
Handling this requires combining the resulting series of captures, mapping the escape character code to its equivalent (e.g. "n" maps to "\n") before doing anything with the Match.
Hi, I'm looking at Patterns to try and pass strings that contain small chunks of source code. I'm trying to work out if I can get it to pass a string that looks like this:
The part I'm troubled with is the string declaration and I'm not sure if Patterns can handle a pattern where I need a double quote following by any number of characters and ending with a second double quote.
The value
"abc"
seems pretty straight forwards. But what if it contains a double quote. i.e"a\"bc"
.The text was updated successfully, but these errors were encountered: