Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exracting Date from string...
#7
Thanks bunches. I still had a lot of troubles clunking around with this so far...but I got it!

Code:
Copy      Help
out
str sFile="$desktop$\CONVERTED\LCL-Short-Show02-2009-October12.WAV"

ARRAY(str) a
int i=findrx(sFile "\d{2}-(\d{4})-([\w)]+)(\d{2})" 0 0 a)
str sDate.from(a[2] "-" a[3] "-" a[1])
DATE d=sDate
out d

Your examples didn't mention anything about using "\w" for words or how the "+" sign works, or that things in the parenthetical statements make up the indexes in the array. I found some good information here: http://www.regular-expressions.info/charclass.html that helped put it all together.

Thanks bunches. You were a big help and I finally think I can start using this stuff. It is pretty powerful!!
Jimmy Vig


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)