Using regex to identify this string???
Hello!
I'm trying to figure out how to use regex to grab the information between the double quotation marks, it will always be in this format:
Code:
Client: ("COMMAND", "DATA(if it exists)", "ARG1(if it exists)", "ARG2(if it exists)", "ARG3(if it exists)")
It will ALWAYS have the "COMMAND" string there no matter what, and when the "DATA" string is there, it can contain any character including:
Code:
"';,.<>/?!@#$%^&*()-=_+[]{}\|~`()
Which I see as becoming another problem itself because what if it contains more opening and closing brackets, and double quotations? How will I identify the information in-between the double quotation mark and grab only that data using regex even if it contains the same thing with-in itself?
For example:
Code:
Client: ("CHAT", "Randombot331", "Hello ("World!")))()()))")
Re: Using regex to identify this string???
do you have to use REGEX? Why not string.substring function to parse out the individual values?
Re: Using regex to identify this string???
Well I was told once upon a time that regex is the best way.
However even using string.substring, it wouldn't work properly because of the character range that is allowed. Unless you can figure out a way to do it.