Re: help with a regex please

2022-06-20 Thread Ryan Schmidt
On Jun 19, 2022, at 16:34, Fred Wright wrote: > I don't know specificlly about reinplace, but here's an example with sed: reinplace is sed -i "" https://github.com/macports/macports-base/blob/master/src/port1.0/portutil.tcl#L951-L953

Re: help with a regex please

2022-06-19 Thread Ken Cunningham
thanks Fred, saw your answer afterwards, much appreciated. Ken

Re: help with a regex please

2022-06-19 Thread Ken Cunningham
thanks for the clue, indeed that was on track. this worked, in the end, once I finally remembered I had to use the “-E” enhancement to reinplace to make it obey the regex — that took an extra hour :> reinplace -E -q {s| --host=[^ ]+||g} ${dir}/bin/jemalloc-config reinplace -E -q {s|

Re: help with a regex please

2022-06-19 Thread Michele Venturi
Q. E. D. On Mon, Jun 20, 2022, 01:05 Ken Cunningham wrote: > > > > On Jun 19, 2022, at 3:24 PM, Joshua Root wrote: > > > > On 2022-6-20 06:34 , Ken Cunningham wrote: > >> to fix the universal build of some ports, eg jemalloc, I would like to > strip out the host bits from these text strings,

Re: help with a regex please

2022-06-19 Thread Ken Cunningham
> On Jun 19, 2022, at 3:24 PM, Joshua Root wrote: > > On 2022-6-20 06:34 , Ken Cunningham wrote: >> to fix the universal build of some ports, eg jemalloc, I would like to strip >> out the host bits from these text strings, eg convert this: >> echo "--prefix=/opt/local --with-jemalloc-prefix=

Re: help with a regex please

2022-06-19 Thread Joshua Root
On 2022-6-20 06:34 , Ken Cunningham wrote: to fix the universal build of some ports, eg jemalloc, I would like to strip out the host bits from these text strings, eg convert this: echo "--prefix=/opt/local --with-jemalloc-prefix= --host=aarch64-apple-darwin21.5.0

Re: help with a regex please

2022-06-19 Thread Eric Borisch
I would think: s/--host(_alias)?=[^ ]*//a On Sun, Jun 19, 2022 at 3:34 PM Ken Cunningham < ken.cunningham.web...@gmail.com> wrote: > to fix the universal build of some ports, eg jemalloc, I would like to > strip out the host bits from these text strings, eg convert this: > > echo

Re: help with a regex please

2022-06-19 Thread Fred Wright
On Sun, 19 Jun 2022, Ken Cunningham wrote: to fix the universal build of some ports, eg jemalloc, I would like to strip out the host bits from these text strings, eg convert this: echo "--prefix=/opt/local --with-jemalloc-prefix= --host=aarch64-apple-darwin21.5.0

Re: help with a regex please

2022-06-19 Thread Michele Venturi
As usual you are asking how to implement your wrong answer to the right question; ask and you shall receive, but not what you want, what you need. Also give more context, context is for kings, live long and prosper... 六‍ On Sun, Jun 19, 2022, 22:34 Ken Cunningham wrote: > to fix the universal

help with a regex please

2022-06-19 Thread Ken Cunningham
to fix the universal build of some ports, eg jemalloc, I would like to strip out the host bits from these text strings, eg convert this: echo "--prefix=/opt/local --with-jemalloc-prefix= --host=aarch64-apple-darwin21.5.0 host_alias=aarch64-apple-darwin21.5.0 CC=/usr/bin/clang” to this: echo