Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular expression to match ALL currency symbols?

Tags:

regex

r

Is there a regular expresion that will match ALL currency symbols (not just $) as they appear in HTML? I am trying to extract all occurrences of money amounts from an html page. Thanks!

like image 250
user1799242 Avatar asked Jan 05 '13 07:01

user1799242


People also ask

What does '$' mean in regex?

$ means "Match the end of the string" (the position after the last character in the string).

What is the difference between () and [] in regex?

6 Answers. Show activity on this post. [] denotes a character class. () denotes a capturing group.

How do I match a regex pattern?

To match a character having special meaning in regex, you need to use a escape sequence prefix with a backslash ( \ ). E.g., \. matches "." ; regex \+ matches "+" ; and regex \( matches "(" .

What is the regular expression matching one or more specific characters?

The character + in a regular expression means "match the preceding character one or more times". For example A+ matches one or more of character A. The plus character, used in a regular expression, is called a Kleene plus .


1 Answers

\p{Sc} seems to be the magic incantation you are looking for.

like image 152
hd1 Avatar answered Oct 06 '22 01:10

hd1