Regular expression for alphanumeric (Unicode) with specific length
You will need a query ahead for this.
You can create a regexp token that will try to find a match, but will not "consume" the input string. You can keep track of it with a simple 2nd query that will check the length of your string.
You can combine them to create your desired query.
The syntax for the .Net version of the regexp engine would be something like this:
This regex is only recorded in this chat and is not validated ... so spare :)
I'm not sure what "symbol or letter" means, but I'm assuming you mean "aZ"
(? =. * [A-Za-Z]). {6.15}
source to share
It looks like it works:
^(?=.*[a-zA-Z].*)\w{6,15}(?<=.*\d.*)$
And here it is with test cases:
http://regexhero.net/tester/?id=83761a1e-f6ae-4660-a91f-9cdc4d69c7b3
Basically, my idea was to first use a positive outlook to include at least one letter. Then I use \ w {5,16} as a simple means of ensuring that I match the correct number of characters (and that they are alphanumeric). And then at the end, I use a positive lookbehind to ensure that the string contains at least one number.
source to share