Alex Rivera | Logout

Purpose of [^\x20-\x7E] in regular expressions

Asked 2009-06-11T19:59:17.927
52
 [^\x20-\x7E]

I saw this pattern used for a regular expression in which the goal was to remove non-ascii characters from a string. What does it mean?

Edit
Report

1 Answer

3

It means "anything that isn't a character code in the hexadecimal range 0x20 to 0x7E, i.e. 32 to 126".

answered 2009-06-11T20:01:45.440

Your Answer