2012-07-17 47 views
-3

我想爲美國電話號碼(如(408)898-8979或(408)898-8589-8989)構建vtype。extjs中正則表達式的電話號碼

正則表達式必須接受任何格式。

我試了很多樣品。

+1

你到目前爲止所嘗試過的。向我們顯示代碼 – diEcho 2012-07-17 13:12:45

+0

閱讀此:https://github.com/RobinHerbots/jquery.inputmask **和** http://digitalbush.com/projects/masked-input-plugin/ – diEcho 2012-07-17 13:13:22

回答

0

(xxx)中的空格是什麼? ext.form.VTypes [「usPhoneNumber」] = /(\ * [0-9] {3} \ *)\ * [2-9] \ d {2} - \ d {4}( - \ d {4})$/

Check this site

0

POSIX格式:

[\(]408[\)][[:digit:]]\{3\}-\([[:digit:]]\{4\}\)\{1,2\} 
0

我認爲你需要這樣的正則表達式:^\(*\d{3}\) \d{3}-\d{4}(-\d{4})?$