Patterns

match

fun match(subject: str) > [str]?

Get first match of the pattern against a string

  • subject: Subject to match the pattern against

Returns: List of match and captures or null if nothing matches

matchAll

fun matchAll(subject: str) > [[str]]?

Get all matches of the pattern against a string

  • subject: Subject to match the pattern against

Returns: List of matches or null if nothing matches

replace

fun replace(subject: str, with: str) > str

Replace first occurence of the pattern

  • subject: Subject to match the pattern against
  • with: Replacement

Returns: New string

replaceAll

fun replaceAll(subject: str, with: str) > str

Replace all occurence of the pattern

  • subject: Subject to match the pattern against
  • with: Replacement

Returns: New string

Last Updated:
Contributors: Benoit Giannangeli