We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

The regex_syntax module

(Obsolete). This module contains a bunch of flags that can be used to change the behavior of the regex regular expression module.

Example: Using the regex_syntax module
# File: regex-syntax-example-1.py

import regex_syntax
import regex

def compile(pattern, syntax):
    syntax = regex.set_syntax(syntax)
        pattern = regex.compile(pattern)
        # restore original syntax
    return pattern

def compile_awk(pattern):
    return compile(pattern, regex_syntax.RE_SYNTAX_AWK)

def compile_grep(pattern):
    return compile(pattern, regex_syntax.RE_SYNTAX_GREP)

def compile_emacs(pattern):
    return compile(pattern, regex_syntax.RE_SYNTAX_EMACS)