Hi i want to use below php regex in spry java script framework but them doesn’t work with spry framework and spry doesn’t let the user to input!.
1)"/^[\d]+$/"
2)"/^([\x{600}-\x{6FF}]+\s)*[\x{600}-\x{6FF}]+$/u"
3)"/^([\x{600}-\x{6FF}]+\d*\s)*[\x{600}-\x{6FF}]+\d*$/u"
please help me to convert them to use in spry framework.
Hi i want to use below php regex in spry java script framework but
Share
/u is not supported, since Javascript regexes only supports unicode in terms of codepoints. \x{???} (unicode codepoints) should be written \u???? in Javascript regex (always 4 digits 0 padded)
In these cases, the following applies to the rest of the regex:
This means we specifically have to allow “foreign” numerals, e.g. Persian (codepoints 06F0-06F9):
(Remove \d if ASCII digits shouldn’t be accepted)
Not sure what the brackets are supposed to be doing in example 1, originally they could be written:
But to add the Persian numerals, we need them, see above.
Update
Spry character masking, however, only wants a regex to be applied on each entered character – i.e., we can’t actually do pattern matching, it’s just a “list” of accepted characters in all places, in which case:
Once again, remove \d if you don’t want to accept 0-9.
Update 2
Now… using regex for validation with Spry:
A similar custom function can be made for case 3.
See examples from Adobe labs