Non-greedy matching for votestrings.
authorThomas Hochstein <thh@thh.name>
Tue, 29 Mar 2022 20:56:47 +0000 (22:56 +0200)
committerThomas Hochstein <thh@thh.name>
Tue, 29 Mar 2022 20:56:47 +0000 (22:56 +0200)
commita7ea02d5923c106e8a1e597d399262ed615a1704
tree4568dd722df61f63e89681d78629f77f47af6ada
parentf90cfdb57f9a32d316de8c5da51d16aaa2dd58c1
Non-greedy matching for votestrings.

A single choice on a ballot has this format:

 #1   [            ]  This or that

The regexp in uvvote.pl's process_vote() will
match and extract what's beetwen "[" and "]".
But if "This or that" contains a "]", the
match will be too greedy:

 #1   [            ]  This [or that]
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ <- match

Fix that by using a non-greedy operator.

Signed-off-by: Thomas Hochstein <thh@thh.name>
uvvote.pl
This page took 0.011144 seconds and 4 git commands to generate.