We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there, I'm evaluating using this library instead of the alternatives since it looks quite nice. But I am enountering some issues.
For example, given this input:
from intxeger import build regex = "a$" result = build(regex)
I am getting this:
op = AT, args = AT_END, max_repeat = 10 def _to_node(op, args, max_repeat): if op == sre_parse.IN: nodes = [] for op, args in args: nodes.append(_to_node(op, args, max_repeat)) if nodes[0] == "NEGATE": values = [c[i] for c in nodes[1:] for i in range(c.length)] nodes = [Constant(c) for c in string.printable if c not in values] return Choice(nodes) elif op == sre_parse.RANGE: min_value, max_value = args return Choice( [Constant(chr(value)) for value in range(min_value, max_value + 1)] ) elif op == sre_parse.LITERAL: return Constant(chr(args)) elif op == sre_parse.NEGATE: return "NEGATE" elif op == sre_parse.CATEGORY: return Choice([Constant(c) for c in CATEGORY_MAP[args]]) elif op == sre_parse.ANY: return Choice([Constant(c) for c in string.printable]) elif op == sre_parse.ASSERT: nodes = [] for op, args in args[1]: nodes.append(_to_node(op, args, max_repeat)) return Concatenate(nodes) elif op == sre_parse.BRANCH: nodes = [] for group in args[1]: subnodes = [] for op, args in group: subnodes.append(_to_node(op, args, max_repeat)) nodes.append(Concatenate(subnodes)) return Choice(nodes) elif op == sre_parse.SUBPATTERN: nodes = [] ref_id = args[0] for op, args in args[3]: nodes.append(_to_node(op, args, max_repeat)) return Group(Concatenate(nodes), ref_id) elif op == sre_parse.GROUPREF: return GroupRef(ref_id=args) elif op == sre_parse.MAX_REPEAT or op == sre_parse.MIN_REPEAT: min_, max_, args = args op, args = args[0] if max_ == sre_parse.MAXREPEAT: max_ = max_repeat return Repeat(_to_node(op, args, max_repeat), min_, max_) elif op == sre_parse.NOT_LITERAL: return Choice([Constant(c) for c in string.printable if c != chr(args)]) else: > raise ValueError(f"{op} {args}") E ValueError: AT AT_END
The text was updated successfully, but these errors were encountered:
From my experience you have to strip ^ and $ from patterns you want to use with intXeger. Not sure why.
Sorry, something went wrong.
No branches or pull requests
Hi there, I'm evaluating using this library instead of the alternatives since it looks quite nice. But I am enountering some issues.
For example, given this input:
I am getting this:
The text was updated successfully, but these errors were encountered: