Home > Blockchain >  In REGEXREPLACE what does this $1 mean?
In REGEXREPLACE what does this $1 mean?

Time:06-26

Google sheets split with regex or regexextract?

The formula to the answer in this question is:

=TRANSPOSE(SPLIT(REGEXREPLACE(A1, "(\d \.)", "♥$1"), "♥"))

I'm confused by what the 1 after the $ sign stand for?

CodePudding user response:

see the explanation:

\d       one single digit
\d       one or more digits
.        one single character
\.       when escaped with a backslash it means dot character
()       group
(\d \.)  group containing number followed by a dot
$1       first group
♥        unique symbol
♥$1      add unique symbol before the group

CodePudding user response:

That means first numeric value found.

Try this to understand

=REGEXREPLACE("123xxx456", "(\d )xxx(\d )", "$2 then $1")

will give 456 then 123

  • Related