Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get data between quotes that isn't surrounded by parenthesis

I’m trying to parse actionscript files and I’m trying figure out a regex that determines whether a line contains a string but at the same time that string isn’t a parameter of a function.

So something like this would be fine and return "derping around" without quotes.

_root.bun = "derping around";

This would also be fine and return "(derping around with parentheses)" without quotes

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

_root.bun = "(derping around with parenthesis)";

This is no good as the quotes are surrounded by parentheses so we return nothing.

gotoAndPlay("derp");

I was looking at this question and while the answer solves a good chunk of my problem I don’t know how I’m supposed to change it to check if theres parentheses around the quotes. Here’s the link.

how to get data between quotes in java?

Any help would be appreciated as I’ve been stuck on this for over a day.

>Solution :

This regex should find the values you’re looking for:

[^(]\".*\"

Test it here: https://regex101.com/r/oCT1V1/1

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading