Using a range of hex values in a CF regular expression
Assume you have a str1 variable with the string to be processed, and you want a resulting str2 holding the result. Let's assume as well that you've been asked to strip any codes with ASCII values of 160 or higher. This will do it:
The CF docs do discuss using the \xnn option to search for a hex value, but they don't show how to specify a range. You might, as I did, try a few variations until you stumble upon it. That's the format.
Oh, and as for the xa0, that's the hex equivalent of decimal 160, and ff is the top of the range. I didn't find that it performed any more slowly with ff or some lower number.
Hope all that's helpful to someone. As for why you may do the above, I'd rather take that up in a separate entry which I hope to write today.


There are no comments for this entry.
[Add Comment]