Looking for a string pattern 'abcd'
followed by a colon(:) and any number of integers, with the restriction that this pattern cannot be repeated.
Here are some examples of valid patterns:
- abcd:23415
- abcd:23
And invalid patterns:
- asda:4535
- abcd
- abcdabcd:324
- abcd:234abcd234
- abcd:234:abcd:234
The attempted pattern was:
((((abcd){0,1}):([0-9].+)){0,1})[^:]
This pattern did not work. The requirement is to use this in ng-pattern, keeping in mind that ng-pattern includes ^ at the beginning and $ at the end. Suggestions for the correct pattern are welcome.