Commit 4e668154 authored by Sam Rushing's avatar Sam Rushing

quickly tossed here to get the ssh lib to work

parent 838e6973
# -*- Mode: Python -*-
# utility functions for building regular expressions
def OR (*args):
return '(?:' + '|'.join (args) + ')'
def CONCAT (*args):
return '(?:' + ''.join (args) + ')'
def NTIMES (arg, l, h):
return '(?:' + arg + '){%d,%d}' % (l, h)
def OPTIONAL (*args):
return '(?:' + CONCAT(*args) + ')?'
def PLUS (*args):
return '(?:' + CONCAT(*args) + ')+'
def SPLAT (*args):
return '(?:' + CONCAT(*args) + ')*'
def NAME (name, arg):
return '(?P<%s>%s)' % (name, arg)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment