I think you will need to do this in Perl, I don't think BBedit/regex can remember anything it met and passed previously and change its value.
Ron

On 06/11/2016 10:04 AM, Michael Baker wrote:
I've been searching through the forum recently and earlier in the year for a solution to a problem I have in updating some text documents I'm working with in BBEdit. My document is in XML format and one of the elements contains an attribute with a text string like "KyChr-DB-B-001", the next "KyChr-DB-B-002, and so on for about 250 entries. I found I had missed an entry around 040. Rather than manually change every occurrence, I'm sure there is a way to script this like a search and replace from a starting point in the document or selecting the part of the document and applying the changes to that part. I'm familiar with Regex, Grep, but don't know of any way to do the mathematical addition to turn the found n part of the string to n+1.

None of the posts I've found so far has a script that I've thought I could modify to do this. What would be the best path for me to start down. I've not used Applescript in a long time but I could modify one if it were very close to what I needed. I know there are some other scripting options in BBEdit.

If this is an easy solution and anyone knows the location of a script that is close enough I could modify, it would save me a lot of time. Or at least if somebody could point me in a direction as to which scripting system or BBEdit function I should pursue.

Thank you,
Michael B.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscr...@googlegroups.com <mailto:bbedit+unsubscr...@googlegroups.com>. To post to this group, send email to bbedit@googlegroups.com <mailto:bbedit@googlegroups.com>.

--
Ron Catterall
r...@catterall.net

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.

Reply via email to