[ad_1]
If you try to parse input date, find first non numeric character
[0-9]+([^0-9]).*
If you try to find element in “mask/template/…” then first character not in set
[dMy]+(\.).*
[ad_2]
solved Use regex to find which date separator a user has inputted