I need to modify the exp:
/^[-\p{L}\d]+$/u
The purpose is to allow maximum 3 digits in whole string, but letter chars and dashes should be allowed without quantity restrictions. No matters where digits are located within string. For instance:
test345 //this should match
345te-st //this should match
3454dtest //this shouldn\'t match
I have already tried some patterns, but is don't work properly:
/^[-\p{L}\d{0,3}]+$/u
/^[-\p{L}]+[\d]{0,3}+$/u
/^([-\p{L}]+)([\d]+){0,3}$/u