#1
  1. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,571
    Rep Power
    595

    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. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,247
    Rep Power
    9400
    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 Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,571
    Rep Power
    595
    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 Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,571
    Rep Power
    595
    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 Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,571
    Rep Power
    595
    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