I want to create a pattern for my string: It should follow this rules:
1th place contains only 4 digits.
2th place contains only one ‘-‘.
3th place contains only 3 digits.
4th place contains only one ‘-‘.
5th place contains only 3 digits.
6th place contains only 6 digits.
7th place contains only one ‘-‘.
8th place contains only 1 digit.
sth like this: 0010-155-072-120410-0
I use this but not work: '/[1-9]{4}-[1-9]{3}-[1-9]d{3}-[1-9]{6}-[1-9]{1}/'
Use this. In your example you have extra
"d"character at the middle.Also don’t forget to include start and end symbols to avoid extra characters at begining and at the end.