jacky lad

jacky lad

  • NA
  • 7
  • 0

Regular expression validation start two fixed character

Sep 10 2020 10:54 AM

Required Regex Validation Start two Fixed character and then after First point required alphanumeric characters and second point required Numeric fixed Character.

Example:

  1. if character start with PB then allow 25 character

- Length : additional 25 numbers. - Example : PB12345Ab8901234567890123mM If “PB” then 25 alphanumeric characters. PB+25numbers

  1. if character start with CC then allow 14 character
- Length : additional 14 numbers. - Example : CC012345678901234 If “CC” then 14 numbers. CC+14numbers
 
(?:PB[\da-zA-Z]{25}|CC\d{14})$ i need in this expression add one more condition if string not start with PB or CC then it's allow 0 to 100 character. 
 

Answers (4)