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:

regular expressions in java?

Posted by Linda Kao on June 29, 2000 at 6:52 PM

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!



Replies:
  • regx john petri July 01, 2000 at 10:44 AM (0)

Sponsored Links



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