Regular expression to identify HTMLEncoded string

G

Gabriela

Hi,
I need help with writing a regexp that identifies HTML encoded
strings.
The problem occurred because I have a field in the DB, that contains
regular ASCII chars, as well as HTMLencoded strings (e.g.:
זאת לא).
Is there a quick way to determine which strings are HTML encoded?
Thanks,
Gabi.
 
E

Evertjan.

Gabriela wrote on 03 nov 2008 in microsoft.public.inetserver.asp.general:
Hi,
I need help with writing a regexp that identifies HTML encoded
strings.
The problem occurred because I have a field in the DB, that contains
regular ASCII chars, as well as HTMLencoded strings (e.g.:
זאת לא).

These all look to me like regular ASCII chars,
as there are no irregular ASCII chars.
Is there a quick way to determine which strings are HTML encoded?

var bolResult = /\&\d{4};/.test(str)

perhaps?

bd way, a javascript string is in unicode, and can contain non-ASCII chars.
 
A

Anthony Jones

Gabriela said:
Hi,
I need help with writing a regexp that identifies HTML encoded
strings.
The problem occurred because I have a field in the DB, that contains
regular ASCII chars, as well as HTMLencoded strings (e.g.:
זאת לא).
Is there a quick way to determine which strings are HTML encoded?

Are you sure their not all HTML encoded? (That is, are there any that
contain characters that would normally be encoded but have not been?).
Do you know how they came to have this encoding?
Are there any HTML specific entities such as   or are they from the
simple XML set.
What is the DB fields data type?

Why do you want to detect, is it because you want to convert the string
back?

If there are no HTML specific entities and its true that there are no values
where character that would normally be encoded aren't, then:-

Dim oXML : Set oXML = CreateObject("MSXML2.DOMDocument.3.0")
oXML.LoadXML "<root>" & sFieldValue & "</root>"

sDecoded = oXML.documentElement.text
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top