I wanted to do a search and replace of all visible characters (Space thru Tilde), except for Comma and Quote, and replace it with a lowercase x.
I tried to use this, but I missed some things.
[x20-x21x23-x2Bx2D-x7E]
Then I tried this, which also missed some things.
([x20-x21]|[x23-x2B]|[x2D-x7E])
Should I really be using this, which also excludes x?
([x20-x21]|[x23-x77]|[x79-x2B]|[x2D-x7E])
Visible Characters, Except for Comma and Quote
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Visible Characters, Except for Comma and Quote
(2[Bb]|[^2].|.[^Bb])
That is the question.
That is the question.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Or you can enter the characters directly:
[ !#-+\--~]
Or you can separate the range from the exclusions by using negative look-ahead:
(?![,"])[ -~]
or positive look-ahead:
(?=[ -~])[^,"]
But do you really need to restrict this to the range space to tilde? If not, you can simply use
[^,"\n]
This way you have to explicitly exclude newline.
[ !#-+\--~]
Or you can separate the range from the exclusions by using negative look-ahead:
(?![,"])[ -~]
or positive look-ahead:
(?=[ -~])[^,"]
But do you really need to restrict this to the range space to tilde? If not, you can simply use
[^,"\n]
This way you have to explicitly exclude newline.