I am working with angularjs form validations, where i have few fields need to validate them, i will only allow the user to enter input starting with certain mix of characters and numbers(will be 7 after characters)like BID0001234, Q0001234 and PO0001234. In this case(BID0001234) i have tried these patterns '^BID/[0-9\d]$/','^BID/^[0-9\d]$/' and '^BID/^[0-9\d]+$/'. for some reason unable to validate it, could you someone please share the experience or direct me towards a regex pattern link that matches my issue.
update: I want to count the numbers after the BID as well, seven numbers are accepted
Any help is much appreciated
No need for the slashes. Try
ng-pattern="'^BID[0-9]+$'"
For exactly seven digits after "BID":
ng-pattern="'^BID[0-9]{7}$'"