#1
  1. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,129
    Rep Power
    601

    Parsing MySQL enum values


    I need a regex for Java's split to parse out MySQL enum values. The string will be of the form:

    enum('v1','v2','v3'...)

    Thanks.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  2. #2
  3. Subconscious Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    15,530
    Rep Power
    9565
    How about a match-all on '...' (which is trivial if the values can't have apostrophes).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,129
    Rep Power
    601
    Unfortunately the values can and do have apostrophes. I hadn't even thought of that problem until you mentioned it.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,129
    Rep Power
    601
    I take that back, they will not have apostrophes. Unfortunately, for me it is still not trivial. I have played with several possibilities but no luck. Mostly I get patternsyntaxexceptions.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,129
    Rep Power
    601
    Never mind, I got it. I didn't realized just how trivial it was.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo