Hi everyone,
I'm trying to scrape a bunch of currency values using the following regex ([\d,.-]+) with the code below. The goal is to extract just the numbers (both positive or negative) without currency symbols or letters.
For some weird reason the regex matches only the "-" symbol for negative numbers skipping the remaining digits, after the match.
Can anyone find what's wrong with my sitemap?
I tested the regex on regex101.com and it seems correct.
This is the part of the sitemap
[...]{
"id":"Amount (Asset currency)",
"type":"SelectorText",
"parentSelectors":[
"Rows"
],
"selector":"div.binding-currency_amount",
"multiple":false,
"regex":"([\d,.-]+)",
"delay":0
} [...]
Dataset looks like this
(-$1.06 EUR)
($1,030.12 CAD)
null
CHF0.01
-CHF0.03
After scraping it I get
-
1,030.12
0.01
-
but it should look like this
-1.06
1,030.12
0.01
-0.03