On 3/16/22 at 2:06 PM, thepo...@gmail.com (ThePorgie) wrote:

I was tinkering with with Patrick's question

Not actually my question ;-) though close enough for the matters at hand.


So I was looking at this and knew it would have to be several passes, but my pattern I was working with for the first pass was "(?P<foo>\d+\.)1"

My question is since I can't use a replace pattern \1 follow by 33

You can in fact do this by prefixing a zero "0" to the singular backreference number, so:

Replace:    \0133

will give you the first backreference \01 followed by the string "33".


I was using a named pattern, but (?P=foo) doesn't call the named pattern
in the replace area of a grep search? Just curious as I couldn't find
anything regarding this in the manual.

Please see the section titled "Subpatterns Make Replacement Powerful" in Chapter 8 (page 202) of the current manual:

Pattern       Inserts
=====================================================
[...]

\P<NAME>      the text matched by the subpattern NAME


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc.             <https://www.barebones.com/>

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: <https://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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/r480Ps-10146i-CC3F755291504BACA67A11A6CED360AC%40Cylinder.local.

Reply via email to