Neil, Okay, I NOW see if I use ";&" OR ";\1" for replacement strings I can get the desired output. I also see if I use as you suggest "backslash + digit" or ";backslash + digit" . . . I simply get THAT text repeated back with no digits at all.
But yeah, you were MOST correct in thinking I did not understand Find and Replace roles used very different command strings. I did not see that explicitly stated in the user manual. Problem solved (at least I think so - it all still performs a bit screwy, I think . . . won't go into detail) [image: --] Marcus Abundis [image: http://]about.me/marcus.abundis <http://about.me/marcus.abundis?promo=email_sig> On Fri, May 10, 2024 at 1:39 AM Neil Faiman <[email protected]> wrote: > Marcus, > > I think that you may not realize that the backslash codes used in > replacement strings are not the same as the backslash codes used in search > strings. > > > - In a *search* string, there is a very rich collection of codes to > describe the things to be matched. > - The *result* of the matching operation is simply an array of matched > substrings corresponding to the parenthesized sub patterns in the search > string. > - The *only* backslash codes in a *replacement* string are a backslash > followed by a digit, which means to insert the corresponding element of the > matched substring array into the replacement string at this point (and “\\” > which means insert a single backslash). All other backslashes are ignored. > > > In particular, “\d, means “match a digit” in a search string, but it means > “ignore the backslash and insert the letter *d*” in a replacement string. > > Again, the way that you insert matched text from the search string is > > > - Use parentheses in the search string to delimit the portion of the > matched string that you want to “capture,” > - Use “backslash + digit” in the replacement string to identify which > captured substring you want to insert in the result. > > > Regards, > Neil Faiman > > On May 9, 2024, at 5:43 PM, Marcus Abundis <[email protected]> wrote: > > Hey Rich, > > Thanks much for looking at this issue! > Okay, I closely read the material in Chapter 8 and explored the Pattern > Playground, and I am pretty sure I understand what I read and saw. > I also feel I have a grasp of HOW wildcard Find and Replace commands are > SUPPOSED to work. > Using a Subpattern structure, as also suggested by Kaveh, such as " > (\d\d\.\d\d\.\d\d\d\d, > \d\d:\d\d, )" does not seem to improve things. > What I am trying to accomplish does not seem that complicated to me, so I > am really scratching my head here. > This software should have fairly stable basic functions after 30 years, no? > It looks to me like I may have encountered a straight-up BUG — in no case > should a "\d" used to find a NUMERIC value produce a "d" ALPHABETIC value > output. > That's just basic mixing apples and oranges, no? I really don't know what > is going on here. > Can you PLEASE tell me what EXACT string(s) you think I should be using > here to realize my desired output? > I would like to confirm this is an actual bug (given I am a noob to > BBEdit), before I waste anyone's time with a bug report? > For your information I am using BBEdit 15.0.3 on MacOS 11.7.10, but I > first encountered this problem on an earlier version of BBEdit and MacOS. > > Thanks much for the help! > > Marcus > On Wednesday, May 8, 2024 at 2:18:36 PM UTC+2 Rich Siegel wrote: > >> On 8 May 2024, at 6:01, Marcus Abundis wrote: >> >> > Greetings, >> > >> > I am new to BBEdit (trying it out) and I have a problem in using the >> > standard “Find and Replace” window in BBEdit. Only the “Grep” and “Show >> >> > matches” boxes checked in that window (no other boxes checked), and the >> >> > situation unfolds as follows: >> > >> > TARGET STRING/FIELD: “ 29.12.2023, 10:23, ” >> > — Target values, held in varied records, with varied fields for each >> > record, all in one .CSV file. >> > >> > FIND STRING: “ \d\d\.\d\d\.\d\d\d\d, \d\d:\d\d, ” >> > — This Find String works exactly as I wish, no problems. >> > >> > REPLACE STRING: “;\d\d\.\d\d\.\d\d\d\d, \d\d:\d\d, ” >> > — This Replace String does NOT work as desired. I want to replace the >> > leading “ ” space with a “;” while RETAINING all original digital >> values. >> >> Chapter 8 of the user manual is an excellent reference to how Grep works >> (in BBEdit and in general), and in particular the section on "Writing >> Replacement Patterns" beginning on page 212 is relevant to your interests. >> >> >> To summarize: you need to specify in your original pattern which part(s) >> it you want to use in the replacement, by putting parentheses around them. >> In the replacement pattern, you can make reference to those subpatterns to >> construct the replacement text. >> >> The user manual is available via the Help menu. >> >> The Pattern Playground (on the Search menu) is handy for exploring match >> and replace behavior, as well. >> >> Enjoy, >> >> R. >> >> >> -- >> Rich Siegel Bare Bones Software, Inc. >> <[email protected]> <https://www.barebones.com/> >> >> Someday I'll look back on all this and laugh... until they sedate me. >> > > -- > 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 on the web visit > https://groups.google.com/d/msgid/bbedit/005e25e9-132d-40ab-bae0-ee160c8cc4adn%40googlegroups.com > <https://groups.google.com/d/msgid/bbedit/005e25e9-132d-40ab-bae0-ee160c8cc4adn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- > 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 a topic in the > Google Groups "BBEdit Talk" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/bbedit/7mjzs8GqtRk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/bbedit/31F99E1C-FB7A-424B-8084-E65902EA4C96%40faiman.org > <https://groups.google.com/d/msgid/bbedit/31F99E1C-FB7A-424B-8084-E65902EA4C96%40faiman.org?utm_medium=email&utm_source=footer> > . > -- 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 on the web visit https://groups.google.com/d/msgid/bbedit/CACJqm9yZTSi07%2Bih-xn86NeiwsjmX66mvKj0j-16H4z4ELFj-g%40mail.gmail.com.
