thank you
четверг, 3 сентября 2020 г., 13:13:59 UTC+3 пользователь Brian Candler
написал:
>
> On Thursday, 3 September 2020 10:15:29 UTC+1, Emilius Omeen wrote:
>>
>> pkg "regexp" not have function which allow many group replace, only have
>> ReplaceAllString
>>
>>
>>
> If I just take the examp
On Thursday, 3 September 2020 10:15:29 UTC+1, Emilius Omeen wrote:
>
> pkg "regexp" not have function which allow many group replace, only have
> ReplaceAllString
>
>
>
If I just take the examples you posted at the start, I can do that with a
single ReplaceAllString:
https://play.golang.org/p/9h
pkg "regexp" not have function which allow many group replace, only have
ReplaceAllString
// ReplaceAllString returns a copy of src, replacing matches of the Regexp
// with the replacement string repl. Inside repl, $ signs are interpreted as
// in Expand, so for instance $1 represents the t
There are various projects that combine multiple regexps into a single DFA.
Have a look at https://github.com/proebsting/re
On Wednesday, 2 September 2020 21:23:40 UTC+1, Brian Candler wrote:
>
> Can you define the problem more clearly?
>
> It looks like you just want to replace a leading "9", "00
Can you define the problem more clearly?
It looks like you just want to replace a leading "9", "001" or "+1" with
"1"? In that case, you just match ^(9|001|[+]1) and replace it with 1
If that's not what you want, then what are the exact rules for how the
input needs to be changed?
--
You rec