'What is the regex for Hindi numbers?
I want to write regex to check validation for Hindi natural numbers.
Regex for natural numbers in English language is : /^[1-9][0-9]*$/
Already Googled it but was not able to find any solution. Please help me.
Solution 1:[1]
Solution 2:[2]
If you want to match Hindi numbers using unicode then use this regex:
/^[\u0967-\u096F][\u0966-\u096F]*$/gm
Check all Hindi unicode points here
Solution 3:[3]
Use the below regex as char in Hindi should start with Hindi char and you can add special char(as optional).
/^[\u0900-\u097F]*[\s]?([\u0900-\u097F]*[\s]?)*?$/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | m0bi5 |
| Solution 2 | Community |
| Solution 3 | RAHUL RAJ |
