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

    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 online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    11,380
    Blog Entries
    7
    Rep Power
    17

    Default Re: regular expression question

    Note that those spaces are significant ...

    kind regards,

    Jos
    Last edited by JosAH; 05-18-2012 at 06:02 PM. Reason: fixed a non-sentence.
    When people rob a bank they get a penalty; when banks rob people they get a bonus.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,918
    Rep Power
    16

    Default Re: regular expression question

    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

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