In addition to the other fine books on regular expressions (grep's  
"toolbox," if you will) mentioned by other responders to this BBEdit  
group, I can recommend <i>Regular Expressions in 10 Minutes</i> by Ben  
Forta (©2004 by Sams Publishing; ISBN 0-672-32566-7). I have the  
Friedl book and, of course, the BBEdit manual, but it's the slim Forta  
book that travels with my laptop's bag because it's comprehensive yet  
svelte (102 pages if you subtract the appendices and index; 146 pages  
in all).

Largely tutorial in nature, the Forta book also serves as a reference  
book for me. Because it's handy, it's the first book I reach for if I  
need to noodle out a regular expression problem. The $15 book also has  
some "canned" regular expressions that can be used to work with such  
things as ZIP codes (US, UK, Canada), US Social Security numbers,  
credit card numbers, IP addresses, URLs, email addresses, and HTML-  
and Java-style comments. It even has a link to a regular expression  
tester ...

        http://www.forta.com/books/0672325667/

... so you can hone your regex expertise.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

On Dec 19, 2008, at 8:49 AM, Chris wrote:

>
> nevermind I figured it out. anyone recommend grep tutorials or book?
> thanks
>
> solution:
> find:  <col id="1">([^<]*)</col>
> replace: <company>\1</company>
>
> On Dec 19, 11:31 am, Chris <thepickled...@gmail.com> wrote:
>> Hi All
>>
>> I am trying to use grep for a find and replace on an xml document.
>> What I am trying to do is select  id="1"
>> then select the closing element "/col" to change to "/company".
>>
>>         <row id="2">
>>                 <col id="1">Sonitrol Corp.</col>
>>                 <col id="2">Joseph Tranfaglia</col>
>>                 <col id="3">1 Merrill St.</col>
>>                 <col id="4">Woburn</col>
>>                 <col id="5">MA</col>
>>                 <col id="6">01801</col>
>>                 <col id="7">www.sonitrol.com</col>
>>                 <col id="8">508-649-2019</col>
>>                 <col id="9">jtranfag...@sonitrol.com</col>
>>                 <col id="10">Electronice Security, Monitoring, Fire  
>> Inspections</
>> col>
>>                 <col id="11">New England</col>
>>         </row>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "BBEdit Talk" group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to "supp...@barebones.com" 
rather than posting to the group.
-~----------~----~----~----~------~----~------~--~---

Reply via email to