Welcome Guest, Not a member yet? Register   Sign In
PCRE - Match pound sign
#1

[eluser]richzilla[/eluser]
Hi All,


How would i match a pound sign in a regular expression?

so far ive tried the hex:

Code:
[\xA3]

and the ascii:

Code:
[\163]

however both of these return false for a valid price:

Code:
£125.22

Just for reference, the regex im running it against (in case ive made a mistake here):

Code:
/^[\xA3]?\s?[0-9]+(\.|\,)[0-9]{2}$/
#2

[eluser]sophistry[/eluser]
did you look at the regular-expressions.info site that i posted in the other thread you made about this regex?

when i clicked to that site i found a page describing something relevant:
http://www.regular-expressions.info/unicode8bit.html

cheers.




Theme © iAndrew 2016 - Forum software by © MyBB