List Info

Thread: How to allow for HTML character references?




How to allow for HTML character references?
country flaguser name
United States
2007-09-26 07:06:26
Hi everyone

In PHP, I am using an ereg_replace to strip all but certain
allowed
characters
from a string:
$string = ereg_replace("([^
0-9A-Za-zŠŒŽšOEžŸÀ-ÖØ-öø-þ-])","",
$string);

I would like to extend this to allow HTML character
references of the
form "&#number;" where number is the three,
four or five digit code
number
of the character.   Examples would be
"ä", "ẽ" and
"茸".

How could I change the expression above to do this?

I am sorry but regular expressions hurt my brain!

Thankyou in advance
Karin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )