Java Regex Help
Go to solution
Solved by wolfsinner,
The following pattern should capture what you need: \\d{1,2}[A-Za-z]{3}
EDIT:
I failed to realize you probably also want some code to go with that.
The following code is untested, but gives you the general idea.
String pattern = "(\\d{1,2}[A-Za-z]{3})";Pattern p = Pattern.compile(pattern);Matcher m = p.matcher(htmlStr);if(m.find()){ for(int i = 1 ; i <= m.groupCount() ; i++){ //treat m.group(i) }}
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now