Skip to content

replaceMatches

Category: String

Returns the input string with all matches of the regex pattern replaced with the replacement string

  • Return type: string
  • Parameters:
    • regex string — Regular expression pattern to match
    • replacement string — Replacement string
'Hello 123 World 456'.replaceMatches('[0-9]+', 'XXX')
Patient.name.text.replaceMatches('\s+', ' ')