At 20:32 -0600 5/24/11, LuKreme wrote:
>On 24-May-2011, at 11:11, David wrote:
>> 
>> I have a bunch of references of the form [ex:7.5.3], [ex:7.5.4], [ex:
>> 7.5.5] etc, and I'd like to change them all to [ex:7.6.3], [ex:7.6.4],
>> [ex:7.6.5], etc. How can I do a search and replace to do this?
>
>find: ex:7\.5\.(\d)
>replace: ex:7.6.\1
>
>The parens capture the last character (only if it's a digit) and the \1 puts 
>it back.
>
>If you were intending to ask how to change 7.5.x to 7.6.x and 7.6.x to 7.7.x, 
>then that is beyond the power of a single regex. You would need a script.
>


Depending on what else is in your documents you just might get away with a 
non-grep global replace:

 [ex:7.5   -->   [ex:7.6

Perhaps you also need to parenthesize the first digit - 7 - which would look 
like:

>find: ex: (\d)\.5\.(\d)
>replace: ex: \1.6.\2

Note the periods - . - that need to be escaped with a backslash - \. - during 
the search with grep enabled. Otherwise they would match any character.

-- 

--> A fair tax is one that you pay but I don't <--

-- 
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