On 26/02/2008, at 03:12 , WinterSmith wrote:
I am trying to find an replace a word (e.g., sail) followed by a
random series of characters (numbers, letters, symbols) of varying
length, followed by a semicolon and a quote (;"). ideas?
I highly recommend reading "Mastering Regular Expressions" by Jeffrey
E. F. Friedl - see http://www.oreilly.com/catalog/regex3/ for
details. Regular expressions are one of those things where reading
half a man page is worse than not reading it at all. If you ever use
Find/Replace with "Use Grep" ticked, you absolutely must read that
book. In fact, Bare Bones Software should make BBEdit scan the
barcode before letting you use that feature :P
Just to reinforce what others have already said:
Given a document containing:
2fr4sail=g%fst5rt423;"a
#$fvsailsss7&8!:;"22
s6gysail76f9^h$2;"99d
In BBEdit, select "Search" -> "Find..."
1) Make sure "Use Grep" is ticked
2) In the "Search For" box, type exactly the following:
sail.*?;"
3) In the "Replace With" box, type:
XXXX
Click "Replace All", and the document will be transformed to:
2fr4XXXXa
#$fvXXXX22
s6gyXXXX99d
Double-check that "Use Grep" is ticked in the Find/Replace dialog,
and that you're using BBEdit 8.6 or newer. And thoroughly digest
"Mastering Regular Expressions" by Jeffrey E. F. Friedl.
Hope this helps
Alex
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, 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: <[EMAIL PROTECTED]>