I'm trying to search for a number/character pattern inside of a string.
The String can look like this
"any text CA-2019-6-000000 any text"
"any text KA 2019-2-929029" // note: no "-" between the "KA and 2019"
"KA-2019-11-929029"
What I can definetly say, There is always a year, like 2000/2019/2055.
After the year is always a minus sign, two possible numbers from 1-12 and another minus sign.
Which is the month.
And after the "-<num>-", is a 6 digits long number which can be at least 000000 or max 999999
Before the year, can be max. two characters long string followed by a minus. Between this two characters long strong could be a minus sign or a space letter.
Examples:
"AA 2019"
"ZZ-2018"
I found out that I could get the 6 numbers with /[0-9]{6}/.
The year by /[0-9]{4}. I would like to add, that it only can be between 2000 and 2100
And I can get the number between the two minus signs with: /(?<=\-)(.*?)(?=\-)/ or
/\-(.*?)\-/
For example, I had the idea to look for the number between the two "-" characters and store it in a variable. Then to say I want to have the numbers between the ones after this variable that are 6 characters long and between 000000 and 999999.
A similar game with that year. I'd want to say I'd get the number which is before the variable with the "--" The maximum length is 4 numbers and is between 2000 and 2100.
If I then have stored the year in a variable I can theoretically say I'm looking for two letters which precede "-$yearvariable" or " [space]$yearvariable

