Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex - Euro symbol and non ASCII characters
#1
Macro GetPrices
Code:
Copy      Help
str s="Price1 - $3.25   Price2 - $3.50"

str pattern=".+ \- [$€£](\d.+) .+ \- [$€£](\d.+)"

ARRAY(str) arr
if(findrx(s pattern 0 0 arr)<0) out "not found"; end

out arr[1]
out arr[2]

Please, how to match euro or pound symbols?

I have tried flag 32, other patterns like \x82\xAC and nothing works, any ideas?
#2
Replace
[$€£]
to
(?:\$|€|£)

In unicode mode these characters consist of 2 bytes. QM regular expressions don't support multibyte characters in [ ]. When in ( ), compares as strings.
#3
Thanks a lot, Gintaras.


Forum Jump:


Users browsing this thread: 1 Guest(s)