The expression thatIf I understood well, you provided (\b\w+\b(?=\.)
) matcheswant to return any word that is immediately followed by a dot in a given string. In the example you provided, the function Reg.Extract("123. xpto.", \b\w+\b(?=\.),1)
REGEX.EXTRACT(“123. xpto.”, `\b\w+\b(?=\.)`,1)
should return the word "xpto" because it immediately follows the dot in"The formula contains a syntax error", since the stringRegex's syntax is incorrect.
If you want to modify the regular expression so that it also captures the word immediately before the dot, you can use a slightly different expressionHere is how your Regex parameter should look like: (\b\w+\b)\.
(Here, theAdding parentheses around \b\w+\b
create a capturing group that includesmake it capture the entire word immediately beforebefore the perioddot. You also need to encapsulate the Regex with double quotes (no single quotes or tildes).
So theThe modified function would look like this: Reg.Extract("123. xpto.", "(\b\w+\b)\.", 1)
. It
Regex.Extract("123. xpto.", "(\b\w+\b)\.", 1)
And it should return the words "123" and "xpto""123."