Regular expression tips

Posted by Kyle Hankinson August 17th, 2022


General

If you need a trigger or alias to match on a regular expression, here are some hints and tips to use.

Regex vailidation

As you type your regex, the main mud display will update to highlight matches.

  • The background will be highlighted with the full match range. The full match can be accessed in script via \0.
  • Each capture group will be underlined and can be used as a paramter in the script starting with \1, \2, \3, etc.

Whitespace

For whitespace (space, tab, linebreak) use the \s+ syntax option. While most muds will use spaces, some muds will use tabs is certain instances which may case a basic space match to fail.


Tags: Scripting