Alex Rivera | Logout

\d only matchs 0-9 digits?

Asked 2013-05-21T05:46:37.120
10

As far as I know, \d should matchs non-english digits, e.g. ۱۲۳۴۵۶۷۸۹۰ but it doesn't work properly in JavaScript.

See this jsFiddle: http://jsfiddle.net/xZpam/

Is this a normal behavior?

Edit
Report

1 Answer

3

In the documention of Mozilla Firefox (https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp) you will find that:

\d  

Matches a digit character in the basic Latin alphabet. Equivalent to [0-9].
answered 2013-05-21T05:51:40.383

Your Answer