| Author |
How to abstract a sub-string fro ma string by using Regular Expression?
|
Thomas Chang
Ranch Hand
Joined: May 13, 2008
Posts: 59
|
|
Assumed I have a string as follow:
"ÖÄÖÜ Stand:¶Œ **üü 12.02.2009ÿÂ"
What I want is, I want to abstract the date "12.02.2009" from this string. I guess one can do this in a simple way by using Regular-Expression.
Has someone idea?
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
|
To the Java Tutorials!! Look at the Matcher and Formatter classes. You can probably write a regex like (\\d{2}\\.){2}\\d{4} or something similar and find where it matches. You will have to check in the tutorial or similar to see whether I have got it right.
|
 |
Thomas Chang
Ranch Hand
Joined: May 13, 2008
Posts: 59
|
|
|
Thanks. I've solved the problem.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32611
|
|
Well done Please tell us how, for the benefit of future generations (or tomorrow's readers).
|
 |
 |
|
|
subject: How to abstract a sub-string fro ma string by using Regular Expression?
|
|
|