Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array Help (parse log file)
#2
Macro Macro1288
Code:
Copy      Help
out

str html=
;03/03/2010 08:39:13 Updated by BOND, JAMES
;This is my update.
;Thanks.
;
;02/03/2010 12:53:14 Updated by Dr. No
;And this is my update..
;
;02/03/2010 12:21:11 Updated by Oddjob
;YAZZAH!

str pattern="(?ms)^[0-9]{2}\/[0-9]{2}\/[0-9]{4} (.*?)(?=[][]\d\d/\d\d/\d\d\d\d|\Z)"

ARRAY(str) a
findrx(html pattern 0 4 a)

int i
for(i 0 a.len)
,out "---- updated ----[]%s" a[1 i]

(?m) - ^ matches line beginning, not only whole text beginning.
(?s) - . matches newlines too.
(.+?) - the ? makes to match minimum text. Default is maximum.
(?=[][]\d\d/\d\d/\d\d\d\d|\Z) - must be followed by another date after 2 newlines, or must be end of text.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)