How to RegexReplace but only for number.
=REGEXREPLACE(A2, ":<BR CLASS="""">[0-9]", ": [0-9]")
The link of sheet is here
.
You can use \d+
(or [0-9]+
) to match one or more digits, and a capturing group (a pair of unescaped parentheses) around the pattern you want to keep, with a backreference to the group value in the replacement:
=REGEXREPLACE(A2, ":<BR CLASS="""">(\d+)", ": $1")
Details:
:<BR CLASS=
- a fixed string""""
- a ""
pattern (since a "
char should be escaped with another "
in a string literal in Google Sheets formula)>
- a >
char(\d+)
- Capturing group 1 ($1
refers to the group value): one or more digits.