The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

regx

Posted by john petri on July 01, 2000 at 10:44 AM

> Is there the equivalent in Java, of C/Unix regular expressions? We are rewriting legacy C code in Java. In the C code we kept complex rules on formatting fields in a regular expression and then it was very easy to check if the field value was valid because we called regexp.

> Example: Something in the format of DD:MM:SS.SSS N/S
> would be described in the regular expression as
> "^([0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{3}[NS])$"

> Then it's just a matter of calling regcomp to compare input with the regular expression. Is there an equivalent in Java?

> Thanks in advance!

There are a few regx libs out there. Here's one.
http://www.savarese.org/oro/



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us