-
1. Re: Single Straight Quote not picked up by the Grep expression
Jump_Over Oct 3, 2013 11:13 PM (in response to agatebill)Hi,
escape dot and dash too. I mean:
[A-Za-z \\.\\-~]]
by the way: doesn't straight ' works?
[A-Za-z \\.\\-']
Jarek
-
2. Re: Single Straight Quote not picked up by the Grep expression
pkahrel Oct 4, 2013 8:19 AM (in response to agatebill)No need to escape inside a character class (apart from the brackets [ and ]), and Jarek is right that ' should work, so this class should work:
[-A-Za-z .']+
Better put any hyphens at the beginning of the class so that they can't be misinterpreted as range symbols: [A-Z.-~]]+ tries to match two ranges: A-Z and .-~], whereas [-A-Z.~]]+ matches -, A-Z, ., and ~]
Tip: you can spare yourself the trouble of double-escaping by using the /. . ./.source format:
/^(\d{1,2})\t[-A-Za-z .]+\t\d{1,2}\t\d{1,2}-\d{1,2}\t\d{1,2}-\d{1,2}\t\d{1,2}-\d{1,2}\t\d{1,2}\t\d{1,2}\t\d{1,2 }\t\d{1,2}\t\d{1,2}\t\d{1,2}\t\d{1,2}\t\d{1,2}\t\d{1,2}$/.source
which has the additional advantage that you can copy and paste between the Find/Change panel and the script text. And \d{1,2} has the equivalen \d\d? which is shorter -- though perhaps a little less clear.
Peter
-
3. Re: Single Straight Quote not picked up by the Grep expression
agatebill Oct 4, 2013 3:46 PM (in response to agatebill)Thanks Jarek for helping me see the obvious. And thanks for the coding tip Peter.

