Results 1 to 3 of 3
  1. #1
    stuckonjava is offline Senior Member
    Join Date
    Jan 2012
    Posts
    151
    Rep Power
    3

    Default regular expression question

    If the question was there are three items A, B, and C, and the user can pick any one of these items, however hte user must pick at least 3 and no more than 20 would the following work?


    [A|B|C] [A|B|C] [A|B|C] [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]? [A|B|C]?


    I know there is a way t make it shorter, but for now would this accept the correct entries?


    Thanks

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,679
    Blog Entries
    7
    Rep Power
    21

    Default Re: regular expression question

    Note that those spaces are significant ...

    kind regards,

    Jos
    Last edited by JosAH; 05-18-2012 at 07:02 PM. Reason: fixed a non-sentence.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: regular expression question

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Regular expression question
    By stuckonjava in forum New To Java
    Replies: 6
    Last Post: 05-11-2012, 05:11 AM
  2. regular expression
    By ehsansad in forum New To Java
    Replies: 8
    Last Post: 03-18-2011, 03:23 PM
  3. regular expression
    By prof.deedee in forum JDBC
    Replies: 3
    Last Post: 02-19-2010, 12:15 PM
  4. regular expression
    By QkrspCmptPop in forum Advanced Java
    Replies: 8
    Last Post: 01-20-2010, 04:55 AM
  5. regular expression
    By ras_pari in forum Advanced Java
    Replies: 27
    Last Post: 10-07-2009, 01:25 PM

Posting Permissions

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