GREP cleanup

36 views
Skip to first unread message

jgill

unread,
Dec 8, 2019, 7:52:05 AM12/8/19
to BBEdit Talk
I need to clean up some OCR documents to find characters that are NOT [A-Z|a-z|0-9|:]

What is the BBEdit GREP syntax for an invered search (-v) ?

Bruce Van Allen

unread,
Dec 8, 2019, 12:30:05 PM12/8/19
to bbe...@googlegroups.com
[^A-Za-z0-9:]

The above character class includes the characters you want, and
the '^' at the start negates them. So the above will match ONE
character that is not any of an upper or lower case a to z or a
colon. You could search on that and replace with nothing.

This is standard PCRE (Perl Compatible Regular Expression)
syntax, not unique to BBEdit.

HTH

--

- Bruce

_bruce__van_allen__santa_cruz__ca_

jgill

unread,
Dec 8, 2019, 12:41:39 PM12/8/19
to BBEdit Talk
Thank you Bruce, I used to know this but, at 74, sometimes I need a reminder.
Reply all
Reply to author
Forward
0 new messages