Skip to content

=REGEXWORDSONLY

The REGEXWORDSONLY function converts a text string into a valid regular expression that matches only the words in the input text while ignoring all punctuation and special characters.

=REGEXWORDSONLY(TextToConvertToRegex)

TextToConvertToRegex – The text string that will be converted into a regex pattern.

  • Takes the input text string.

  • Removes or ignores punctuation and special characters.

  • Converts spaces between words into a regex pattern (\W+) that matches any non-word characters.

  • Produces a regex string that matches the original words in sequence regardless of punctuation differences.

  • Formula functions are case sensitive and must be written in ALL CAPS.

  • Useful for building flexible regex patterns from human-readable text.

  • Helps match phrases even when punctuation or spacing varies.

  • Often used together with functions like REGEXFIND for advanced text searching.

  • Preserves word order while generalizing separators.

=REGEXWORDSONLY(I Want - To , Find * This ^ Text.)
I\W+Want\W+To\W+Find\W+This\W+Text

REGEXWORDSONLY, regex builder, word-only regex, remove punctuation, text to regex, pattern matching, flexible search, workflow formulas, formula function