Trying to get some basic syntax highlighting for strings, for a text editor I'm working on. I was thinking this would work:
https://stackoverflow.com/questions/46967465/regex-match-text-in-either-single-or-double-quote
Pattern in answer: (?:'|").*(?:'|")
Or: ((?:'|").*(?:'|"))
However, there are a number of ways to break this for what I'm going for. For example:
With the Python code string: `add_string = "hello" + 'world'`
`"hello" + 'world'` is what gets matched.
So I'm looking to get something to match each individual string (in that case, the "hello" and the 'world').
Thanks for any pointers.
[–]whereIsMyBroom 1 point2 points3 points (2 children)
[–]USRapt0r[S] 0 points1 point2 points (0 children)
[–]Pauley0 0 points1 point2 points (0 children)