Link to home
Start Free TrialLog in
Avatar of dkim18
dkim18

asked on

RE or stringTokenizer for searching??

Hi
I have file names in this format, "MMDDYY" in a folder.
I am trying to find all the file names when MM/YY is given.
so 09/05...I want to find all the file names in 09 in 2005.

Should I just break the file name into char[0-1], char[2-3], char[4-5]??

Or is there better way to search with RE??
Thanks for your help in advance.



Avatar of Ajay-Singh
Ajay-Singh

you can use the following regex:

String month = ...
String year = ...
String regex = month + "[0-9]+" + year;
ASKER CERTIFIED SOLUTION
Avatar of Ajay-Singh
Ajay-Singh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkim18

ASKER

I just used substring().
Thanks.