1
I’m trying to detect if a particular address corresponds to a Brazilian highway.
For example, br-101 corresponds.
My initial plan was to list the state acronyms (mg, sp, Rn ...) plus the br acronym, and write something like /sigla1-[0-9]{3}|sigla2-[0-9]{3}.../.
But a query to wikipedia brought me a surprise: there are other prefixes besides states. (for example, prc, in https://pt.wikipedia.org/wiki/Rodovias_do_Paran%C3%A1)
I ask then: What is the most correct way to detect the highways?
We can take (duas_ou_tres_letras)-(tres_numeros), for example. The part before the hyphen necessarily has two or three letters? the part after the hyphen may have less than three numbers?
Would someone happen to have a list of possible acronyms that might come before the hyphen?
It seems that the pattern
2|3 letras - 3 númerosis valid. Can do?– Woss
Yes, yes. My problem is not writing reg Exp, but knowing which criterion is the most reasonable. If it existed, I would be asking in stack overflow DER, not in programming...
– josinalvo