Discussion:
Wish: Grep Patterns without Grep
Ward Clark
2008-04-27 18:02:57 UTC
Permalink
I've used the ability to save Find & Replace patterns to simplify some
repetitive tasks (e.g., update Finder paths in Automator scripts when
I moved referenced folders).

What I had not realized is these "Patterns" (so named in the Find &
Replace dialog) are actually "Grep patterns" (so named in BBEdit
Preferences > Text Search). My learning scenario:

1. Perform a simple text Find & Replace.

2. Use Patterns > Add to save the find and replace string pair for
later.

3. Later, re-use the saved pattern ... and get wild replacement
results.

Fortunately, I have the "Color Grep patterns" preference enabled and
noticed a colored "&" in the Replace string/pattern. Then I
discovered that retrieving my saved pattern automatically enables the
"Use Grep" option.

I briefly tried learning to turn off "Use Grep" when retrieving a
saved pattern. I soon realized it was safer to escape the Grep
special characters in my patterns. (Aside: This would be easier if
the pattern editing dialog used Grep color-coding.)

Wish: Use the Patterns feature to save simple text string that are
not interpreted as Grep patterns.

For example,

a. Save and restore the state of the "Use Grep" option along with the
Find and Replace strings/patterns.

b. Include the "Use Grep" option in the "Add/Replace Grep Pattern"
and "Create/Edit Grep Pattern" dialogs.

-- Ward

[I'm CC-ing this suggestion to <***@barebones.com>.]
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Ward Clark
2008-04-28 01:47:50 UTC
Permalink
Seven hours ago, I wrote ...
Wish: Use the Patterns feature to save simple text strings that are
not interpreted as Grep patterns.
Since then, I've been experimenting and realized that wish was just
the beginning of ...

Wish: Provide the ability to save and recall Find & Replace dialogs
in all their glory.

The Find & Replace dialog current saves search and replace text for
the duration of a session -- see the "Search For:" and "Replace With:"
menus.

What I envision is saving pairs of Search and Replace, along with Case
Sensitive, Start at Top, Search Backwards, etc., in much the same way
Grep Patterns are currently saved, recalled and edited.

-- Ward
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Lee Smith
2008-04-28 03:03:39 UTC
Permalink
Store them as a Grep Pattern. It is available in the Find Edit Box.

Lee
Post by Ward Clark
Seven hours ago, I wrote ...
Wish: Use the Patterns feature to save simple text strings that
are not interpreted as Grep patterns.
Since then, I've been experimenting and realized that wish was just
the beginning of ...
Wish: Provide the ability to save and recall Find & Replace
dialogs in all their glory.
The Find & Replace dialog current saves search and replace text for
the duration of a session -- see the "Search For:" and "Replace
With:" menus.
What I envision is saving pairs of Search and Replace, along with
Case Sensitive, Start at Top, Search Backwards, etc., in much the
same way Grep Patterns are currently saved, recalled and edited.
-- Ward
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Loading...