language agnostic - Regex match all the words outside quotation marks? -
Is it possible to match text outside the quotation marks by using the standard regex parser? I have seen this answer, but it is done using PCR:
This is not a pure solution due to using Perl. I know that it uses the programming language It can also be solved by using, but this idea is to use the pure Regedx Parser.
I did something like that, but it is not working properly
[^] (? = (?: ([']] + ( . *? \ 1)) | ([^ ''] * $))
Thank you in advance.
UPD1 : This idea is to match any type of text to quotation marks; the solution should not depend on the input.
& lt; Yourtext & gt; (? = =? (?: [^ "] *" [^ "] *") * [^ "] * $)
Yes, you can use it positively But it assumes that you have balanced "
and there is no stray "
somewhere lying. See the demo.
Comments
Post a Comment