We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4985d16 commit 3bd28dcCopy full SHA for 3bd28dc
outlines/fsm/json_schema.py
@@ -195,13 +195,7 @@ def to_regex(
195
to_regex(resolver, t, whitespace_pattern) for t in instance["oneOf"]
196
]
197
198
- xor_patterns = []
199
- # json schema validation ensured there is no overlapping schemas in oneOf
200
- for subregex in subregexes:
201
- other_subregexes = filter(lambda r: r != subregex, subregexes)
202
- other_subregexes_str = "|".join([f"{s}" for s in other_subregexes])
203
- negative_lookahead = f"(?!.*({other_subregexes_str}))"
204
- xor_patterns.append(f"({subregex}){negative_lookahead}")
+ xor_patterns = [f"(?:{subregex})" for subregex in subregexes]
205
206
return rf"({'|'.join(xor_patterns)})"
207
0 commit comments