• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Regex pattern matching for current date time  RSS feed

 
thomas jacob
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I want to use java regex for pattern matching current system date time. Basically I have a real time application and want to pick files that match the current date time stamp. Please suggest


Thanks
Thomas

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thomas,
The time changes often. Think about what level of granularity you want - minute, second?

I would do this in two passes.
1) Get the month/day/year/hour/etc into variables
2) Build a regular expression matching the format of the datetime in your source string based on those values.

See how far you can get. Can you do this for just the year?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!