Using BBEdit version14.6.9, I replicated Bruce's test string with original search pattern and his proposed corrected one. Both worked fine, neither generated an application error.
On Saturday, December 14, 2024 at 3:07:35 PM UTC-8 Bruce Van Allen wrote: > Hi, > > An example of the text and a description of what you’re trying to > accomplish would help. > > From your find pattern, I’m guessing you’re trying to find cases where a > string is followed by the same string, to be replaced by just one instance > of the string. > > '\b(\w+)+\1\b’ (your original - without the quotes) > > Your find pattern’s second plus sign ‘+’ isn’t doing anything, because the > first one, which quantifies the ‘\w’, is grabbing every consecutive > word/alphanumeric character including any repetitions. > > Removing that second ‘+', the find pattern '\b(\w+)\1\b’ (without the > quotes) will find a string of word characters followed immediately by the > same string, as in ‘My sentence is abcabc for defdef.’ Using your > replacement pattern of ‘\1’, this will become ‘My sentence is abc for def.’ > > Guessing that you’re are actually looking for duplicated WORDS, if the > find pattern has a spacebar space ‘ ‘ then it will find any word followed > by a space and then the same exact word, and the replacement will eliminate > the duplication. > > With find pattern '\b(\w+) \1\b’, your replacement pattern makes 'My > sentence is abc abc for def def.’ into 'My sentence is abc for def.’ > > If you want to find a string of word characters that matches an earlier > instance of the same string but separated by more than just a space, your > pattern may be more complicated. > > HTH and please clarify if my guesses are wrong. > > — Bruce > > _bruce__van_allen__santa_cruz_ca_ > > > > On Dec 14, 2024, at 1:43 PM, ce gm <[email protected]> wrote: > > > > Hello there, > > > > I am doing a GREP search on a .txt file in Bbedit on my Mac. Here are > the find/replace terms: > > Find: \b(\w+)+\1\b > > Replace: \1 > > > > When I input the Find term, it correctly identifies the targets in the > preview (highlights them in yellow). Then, when I push Replace All, I get a > pop up with Application Error Code: 12247 and nothing else. > > > > Anyone know what this means? A cursory Google search was not helpful. > > > > Thanks! > > > > -- > > This is the BBEdit Talk public discussion group. If you have a feature > request or believe that the application isn't working correctly, please > email "[email protected]" rather than posting here. Follow @bbedit on > Mastodon: <https://mastodon.social/@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 [email protected]. > > To view this discussion visit > https://groups.google.com/d/msgid/bbedit/c9e18d6f-f5c4-467e-9c01-fa4ffbaa5485n%40googlegroups.com > . > > -- This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "[email protected]" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/bbedit/9e9d2bf9-008d-47ba-b08f-cd4330455f92n%40googlegroups.com.
