Commit 70c94566 authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud

should-vdj-to-tap.py: Take care of alternatives

Otherwise the .* was put between the alternatives which lead to a different behaviour for the last alternative

Fix #3784
parent 8cfdc528
......@@ -166,7 +166,11 @@ def should_pattern_to_regex(p):
for term in p.split():
r += process_term(term)
regex_pattern = '.*'.join(r)
if len(r) > 1 and r[1][0] == '|':
# We have an alternative
regex_pattern = '('+' '.join(r)+').*'
else:
regex_pattern = '.*'.join(r)
try:
regex = re.compile(regex_pattern)
......
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