Results 1 to 3 of 3

Thread: Using regex to identify this string???

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    16

    Question 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:
    "';,.<>/?!@#$&#37;^&*()-=_+[]{}\|~`()
    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!")))()()))")
    Last edited by Lexsym; Apr 10th, 2012 at 11:55 AM.

  2. #2
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 2010
    Location
    Pittsburgh
    Posts
    452

    Re: Using regex to identify this string???

    do you have to use REGEX? Why not string.substring function to parse out the individual values?
    if i was able to help, rate my post!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    16

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width