Technical question
Aug. 14th, 2008 10:05Is there a regular expression that would allow me to replace any character above ASCII-128 in a string with the HTML entity equiv, an in:
replace in {string}: ascii-X with &#X; where X between 128 and 255
It would save a nested loop if I could figure out how to do it in one statement.
replace in {string}: ascii-X with &#X; where X between 128 and 255
It would save a nested loop if I could figure out how to do it in one statement.
no subject
Date: 2008-08-14 15:48 (UTC)Even if you could convert the entire string to its component ascii values before looking at it, you would still have to break it up in to 3-digit chunks and examine each one before converting it back. Running a regex search on 3-digit chunks of that would very likely mess it all up.