Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
findrx html tags
#1
i am not good in regex (not now), how can i extract the text between:

<!--StartFragment--> and <!--EndFragment--> when using

introtext.getclip("HTML Format") ?

this is my current working result:


[Image: qm2f2b.jpg]


btw. this posting took me over 2 hours, but isn't it nice ?
pi
#2
Code:
Copy      Help
str s.getclip("HTML Format")
str ss
if(findrx(s "(?s)(?<=<!--StartFragment-->).+(?=<!--EndFragment-->)" 0 1 ss)<0) ret
lpstr es=curl_escape(ss ss.len); ss=es; curl_free(es)
comments:
(?s) - sets "dot matches newline" option
(?<=x) - preceded by x
(?=y) - followed by y
.+ - 1 or more any characters
#3
your code returns:

Code:
Copy      Help
btw%2E%20this%20posting%20took%20me%20over%202%20hours%2C%20but%20isn%27t%20it%20nice%20%3F%3CBR%3E

why do you use curl for that ?
pi
#4
Generally, http post string should be urlencoded. But if your server accepts non-urlencoded string, delete the last line.


Forum Jump:


Users browsing this thread: 1 Guest(s)