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:

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)

A Django site. rendered by a django application. hosted by webfaction.