Posted By

roberocity on 10/10/06


Tagged

regex date


Versions (?)

WTD Regex Date Syntax


 / Published in: Other
 

  1. (^ # \1 start of line
  2. (?<sm>\d{1,2}) # "sm" start month
  3. /
  4. (?<sd>\d{1,2}) # "sd" start day
  5. (/(?<sy>\d{2,4}))? # \2 start year (optional)
  6. \s*? # space separator
  7. (-\s*? # \3 optional end date
  8. (?<em>\d{1,2}) # "em" end month
  9. /
  10. (?<ed>\d{1,2}) # "ed" end day
  11. (/(?<ey>\d{2,4}))? # "ey" end year (optional)
  12. )? # ending date is optional
  13. \s*?
  14. ((?<task>[A-Z]{2,4})\s*?)? # optional task code
  15. (?<desc>.*) # "desc" description of task
  16. )

Report this snippet  

You need to login to post a comment.