Regex pattern using Javascript
Application Type

Hi, Can anyone help me to find the regex pattern for specific string, Example - F8765

the character should start with only  F  and followed by that the 4 digit numbers. 

There are components which could do this easily but I don't want to use it, just validating using JavaScript.  

Hi Kunal,

For something that simple IMHO you do not need a regex, you can just do something like in the image below:

If you do this way, I would suggest to split the above conditions into different IFs.


Hi Kunal ,

Below is the regex expression and some test results.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.