File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Elasticsearch in Action
this week in the
Joined: Jul 27, 2007
Jun 09, 2008 09:42:00
I'm trying to match the following
7 numeric digits optionally followed by an 'x'. If there is an 'x', then the 'x' needs to be followed by at least one digit.
Here's what I have so far for my regex:
Edit: To clarify, the issue with my current regex is getting it to match the case of just 7 digits without the 'x'.
[ June 09, 2008: Message edited by: Alex Wong ]
Joined: Nov 08, 2001
Jun 09, 2008 09:59:00
well [0-9] is \d so you can shorten it up a bit
I think it should be something like this:
I need a help with a regular expression please
Error from sudoku class
doubt on group() in Matcher class
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015