Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Conditional Regular Expressions in ORO

Reply
Thread Tools

Conditional Regular Expressions in ORO

 
 
Ion Freeman
Guest
Posts: n/a
 
      07-23-2009
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?
 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      07-23-2009
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?



 
Reply With Quote
 
 
 
 
Stefan Ram
Guest
Posts: n/a
 
      07-23-2009
Ion Freeman <(E-Mail Removed)> 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?

 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      07-24-2009
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 |
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional regular expressions Morfys Perl Misc 14 08-14-2007 06:29 PM
oro regular expression Robert Mark Bram Java 4 03-17-2006 04:14 AM
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Position of test values in conditional expressions =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?= C++ 23 06-28-2004 08:02 PM
Add custom regular expressions to the validation list of available expressions Jay Douglas ASP .Net 0 08-15-2003 10:19 PM



Advertisments