I'm in PHP. I'd like to find numbers in a sentence that start with a currency symbol, and returns the number. To search "I spent €100 on shoes" and return "100".
I've got this working for $ and £:
'/[$£]([0-9.]{1,})/'
But adding the € euro symbol doesn't work. (The sentences come from parsed emails, so I don't need to find €);
preg_match_all('/[€]([0-9.]{1,})/', $sentence, $match);
I've found the following on SO: regex for currency (euro) But it doesn't encode the euro symbol.
To encode the euro symbol, I've tried:
/[\x{20ac}]([0-9.]{1,})/u
"[^-a-zA-Z0-9.:,!+£$ \\ ". chr(164) ."]"
But can't figure it out. Any help?