Unexpected results from bible passage regex parsing
Original Launchpad bug 1638620: https://bugs.launchpad.net/openlp/+bug/1638620
Reported by: phill-ridout (Phill).
I come across this potential issue whilst writing a test for the bible reference regex.
The easiest way to reproduce it is to do the following:
-
Put a breakpoint on: to_verse = range_match.group('to_verse') in openlp.plugins.bibles.lib.parse_reference
-
Run OpenLP with a debugger.
-
Enter a bible search, say "Matthew 1"
-
Click search.
-
You should hit the breakpoint. If you inspect from_chapter, you will see that it is None. Inspect from_verse and its 1. I would expect this to be the other way round.
Search appears to be working as expected. However, if somebody decided to reuse this regex somewhere else in the code, it has a potential to introduce a bug!