Conditional Regular Expressions in ORO

Discussion in 'Java' started by Ion Freeman, Jul 23, 2009.

  1. Ion Freeman

    Ion Freeman Guest

    Hello!
    I'm trying to match 'b' or 'abc' -- so, a simple '(a)?b(?(1)c)' should
    do it. Now, the java.util.regex classes don't do it, so I'm trying
    ORO. However, ORO gives me

    Sequence (?(...) not recognized

    So... does anybody know if ORO does not support this as well? Is there
    a Java library out there that does?
     
    Ion Freeman, Jul 23, 2009
    #1
    1. Advertising

  2. Ion Freeman

    markspace Guest

    Ion Freeman wrote:
    > Hello!
    > I'm trying to match 'b' or 'abc' -- so, a simple '(a)?b(?(1)c)' should
    > do it. Now, the java.util.regex classes don't do it,



    This is funny, because I'm just playing around with the little Java
    regex tester I built.

    Match b or abc: b|abc

    OK, that was easy. How about: a?bc?

    Both work for me. Are you sure you checked this correctly? Because
    your pattern gives me an exception. How about posting an SSCCE?
     
    markspace, Jul 24, 2009
    #2
    1. Advertising

  3. Ion Freeman

    Stefan Ram Guest

    Ion Freeman <> writes:
    >I'm trying to match 'b' or 'abc'


    b|abc

    >'(a)?b(?(1)c)' should do it


    Which language is this supposed to be written in?
     
    Stefan Ram, Jul 24, 2009
    #3
  4. On Thu, 23 Jul 2009 15:34:00 -0700, Ion Freeman wrote:

    > Hello!
    > I'm trying to match 'b' or 'abc' -- so, a simple '(a)?b(?(1)c)' should
    > do it.
    >

    What's wrong with "(b|abc)" ?


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Jul 24, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Douglas
    Replies:
    0
    Views:
    635
    Jay Douglas
    Aug 15, 2003
  2. Robert Mark Bram

    oro regular expression

    Robert Mark Bram, Mar 16, 2006, in forum: Java
    Replies:
    4
    Views:
    408
    Alan Krueger
    Mar 17, 2006
  3. Alec S.
    Replies:
    10
    Views:
    10,299
    Alec S.
    Apr 16, 2005
  4. Morfys

    conditional regular expressions

    Morfys, Aug 13, 2007, in forum: Perl Misc
    Replies:
    14
    Views:
    195
    Bill H
    Aug 14, 2007
  5. Noman Shapiro
    Replies:
    0
    Views:
    254
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page