I am trying to create a regular expression to validate bible quotes like this:
1 de tesalonicenses 4:20-40
mateo 8:34
marcos 6:2-40
mateo 7
But let me validate negative quotes like these:
mateo 345:0
mateo
1 tesalonicenses 7:20
mateo 8:3-567
I have created this expression:
(?!\s)([1-3]{1} de )?([a-z]{3,15} [0-9]{1,2}:[0-9]{1,2})(-[0-9]{1,2}){0,1}
but don't flag this kind of quotes false:
1 tesalonicenses 7:20
1 mateo 6:20-348
Thank you in advance for your help.
I share this page where I test regular expressions https://regexr.com/
I answer my own question since I haven't found a correct answer:
My somewhat ugly but functional solution to validate the biblical citation format:
If anyone can and wants to simplify it to make it look elegant and professional that would be great. Otherwise, hopefully my solution helps someone.