On 2010-12-15, Dave Ratcliffe wrote:

I note at the end of the "Searching with Grep" section of the online
help manual that O'Reilly & Associates' "Mastering Regular
Expressions," is recommended. Is there anything that any of you think
is superior to this as a comprehensive reference for grep and regular
expressions?

That's the best. Worth investing in the latest edition (third, 2006), but a used first (1997) or second edition can teach most of it.

In my own experience and observation of others, you can probably expect to work your way up through levels of regex power. A worthy height to reach is facility with look-ahead and look-behind assertions, both positive and negative (see Ronald's suggestion).

Other resources:

O'Reilly also has a pocket reference, and I see they now have a Reg Ex Cookbook but I haven't read it.

As additional learning tools, check out a swell pair of features in BBEdit's search dialog:

- it caches recent search expressions (see the clock icon); and
- you can save and name your regexen for convenient future use (the 'g' icon).

These features allow you to rapidly try variations without losing previous tries. I save regexen to use for tasks I expect again and sometimes just to enjoy the satisfaction of composing one that powerfully handled a problem.

BBedit also gives you the ability to properly escape characters as needed for use in regular expression searches, with the menu command Search -> Use Selection for Grep Search. This can be a guide in learning when to escape which characters when creating regular expressions by hand.

Finally, this BBEdit list has some master regex adepts, among them some who responded to your post, and is a friendly place for learning (provided that you try it first on your own :-).

HTH


   - Bruce

_bruce__van_allen__santa_cruz_ca_

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to