Skip to content

Commit

Permalink
spyne.util.invregex.invert -> invregex
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Oct 27, 2012
1 parent e846f63 commit 79c7d0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spyne/util/invregex.py
Expand Up @@ -12,7 +12,7 @@
# - | alternation
#

__all__ = ["count", "invert"]
__all__ = ["count", "invregex"]

from pyparsing import Combine
from pyparsing import Literal
Expand Down Expand Up @@ -227,10 +227,10 @@ def count(gen):
return i


def invert(regex):
def invregex(regex):
"""Call this routine as a generator to return all the strings that
match the input regular expression.
for s in invert("[A-Z]{3}\d{3}"):
for s in invregex("[A-Z]{3}\d{3}"):
print s
"""
invReGenerator = GroupEmitter(parser().parseString(regex)).make_generator()
Expand Down Expand Up @@ -278,8 +278,8 @@ def main():
print '-' * 50
print t
try:
print count(invert(t))
for s in invert(t):
print count(invregex(t))
for s in invregex(t):
print s

except ParseFatalException,pfe:
Expand Down

0 comments on commit 79c7d0f

Please sign in to comment.