Re: A Question Derived from Converting decimal value

2022-03-16 Thread ThePorgie
Thank you sir! Don't know how I missed that in the manual and I promise I 
did look there first.

On Wednesday, March 16, 2022 at 4:13:30 PM UTC-4 Patrick Woolsey wrote:

> On 3/16/22 at 2:06 PM, thep...@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\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 the text matched by the subpattern NAME
>
>
> Regards,
>
> Patrick Woolsey
> ==
> Bare Bones Software, Inc. 
>
>

-- 
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: 
--- 
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/daa9a0b4-0151-4404-a775-ba345a104655n%40googlegroups.com.


Re: A Question Derived from Converting decimal value

2022-03-16 Thread Patrick Woolsey

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\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  the text matched by the subpattern NAME


Regards,

 Patrick Woolsey
==
Bare Bones Software, Inc. 

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


A Question Derived from Converting decimal value

2022-03-16 Thread ThePorgie
I was tinkering with with Patrick's question regarding replacing the digits 
where the "n.1" is replaced with "n.33" and "n.2" is replaced with "n.67"
His sample data:
*Sample  Desired output*
0.20.67
1.11.33
1.11.33
1.21.67
1.11.33
66
3.2 3.67
88
6.2 6.67

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\d+\.)1"
My question is since I can't use a replace pattern \1 follow by 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.

-- 
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: 
--- 
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/37810128-a19b-480d-aceb-5f67fb812d6en%40googlegroups.com.