accelmo.machine.patterns¶
Element-name patterns: the accelerators write Lua patterns, other backends match them as regex.
- accelmo.machine.patterns.lua_to_regex(pattern)[source]¶
Compile a Lua pattern as a regex with the same matches (use
.search, asstring.match).Supports anchors,
.,%classes and escapes, sets[...]/[^...], the quantifiers* + ? -and captures. RaisesValueErroron%b,%fand back-references.- Return type:
Pattern[str]- Parameters:
pattern (str)