Can anyone help me with a regular expression that returns
the following pattern, if found: "Alpha-num-num-Apha-num-num"
Examples:
"WEBSERVER\TV-Show\Flash Gordon\flash.gordon.2007.s01e12.avi"
"WEBSERVER\TV-Show\Flash Gordon\Flash.Gordon.S01E01.avi"
"WEBSERVER\TV-Show\Flash Gordon\Flash.Gordon.S01E02.avi"
Should return:
s01e12,
S01E01,
and S01E02 respectively...
TIA...

Signature
Dag.
Roedy Green - 07 Nov 2007 00:33 GMT
>Should return:
>s01e12,
>S01E01,
>and S01E02 respectively...
see http://mindprod.com/jgloss/regex.html
Look up the source code for how to use a Matcher.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Arne Vajhøj - 07 Nov 2007 03:11 GMT
> Can anyone help me with a regular expression that returns
> the following pattern, if found: "Alpha-num-num-Apha-num-num"
[quoted text clipped - 7 lines]
> s01e12, S01E01,
> and S01E02 respectively...
Try:
Pattern p =
Pattern.compile("\\p{Alpha}\\p{Digit}\\p{Digit}\\p{Alpha}\\p{Digit}\\p{Digit}");
Arne