I'm trying to do a find and replace to match whole sentences which may, or may not be on multiple lines.
Needs to match all of the following, ignoring new line
Example:
Telephone Automatic Answering
Equip & Systems
or
Telephone Automatic Answering Equip & Systems
______________________________________________________________________
This is a real problem unless your sentences are demarcated by punctuation or whitespace. Can you provide a more complete example? One that shows more of the document structure?
If paragraphs are separated by a couple of returns or linefeeds you can do something like:
(?sm)^\w+.+?(?=\r{2,})
But more info please.
Does anyone have any suggestions for some additional tools, to learn GREP other than, the Text Wrangler tutorial? I'm having difficulty figuring all of this out.
Learning grep is a lifetime enterprise, so don't feel bad about the bumpy road. The basics are relatively easy, but becoming an advanced player requires time, dedication, a lot of practice, and some tutelage.
Here are a few useful online resources:
There's a decent little utility available on the App-Store called 'Patterns' that live-updates as you create your pattern. ($2.99)
I've found it very handy to have live feedback when building a complex pattern and wish I'd had something like that when I started learning regex 20+ years ago.
I have these books (in addition to a couple of tomes on Perl):
"Sams Teach Yourself Regular Expressions in 10 Minutes" by Ben Forta
"Beginning Regular Expressions" by Andrew Watt
"Regular Expressions Cookbook" by Jan Goyvaerts and Steven Levithan
"Mastering Regular Expressions" by Jeffrey Friedl (Advanced)
--
Best Regards,
Chris