Pattern Matching

Regular Expressions & Abnormal Expressions

You can use pattern/text matching in two different ways. Ask also supports pythons raw strings, which is the prefered way to write patterns.

Using Regex

Use Python's own built-in re library for regexes.

Using Abnex

Abnex or Abnormal Expressions is an alternative to regular expressions. It's goal is to make it easier to read and write patterns. Not only does it allow for e.g. spaces inside the pattern and less forward slashes, but it also uses characters that might be considered to be more "logical" e.g. not is represented by an exclamation point !, groups with curly brackets { }, and so on.

Read more about Abnex here.

Call Abnex's different functions on the pre-imported ab object.

Last updated