Forum

Yampiz Forum

Sharing let knowledge Spreaded, Reading let spirits growth, Creative let culture extended, Let us
  • 禁止廣告文
  • 知識傳播
  • 閱讀
  • 心靈成長
  • 創作
  • 文化傳承
Forum Dictionary / Programming / 網頁/網站程式 / JavaScript /

Javascript 正規化表示法速查表

New Subject
Random
Previous
Next
|
Javascript 正規化表示法速查表

符號 表示式 說明或範例
. a. 表示任何字元。
含字母 "a" 以及其後任一個字元的字串。
Ex: "ab", "bac"
重覆字串
* ab* 表示沒有或更多字元。
"ab*":表示一個字串有一個a後面跟著零個或若干個b。
Ex: "a", "ab", "abbb"
+ ab+ 一次或更多字元。
"ab+":表示一個字串有一個a後面跟著至少一個b或者更多
Ex: “ab”,”abbbb”
? ab? 沒有或一次字元。
ab?":表示一個字串有一個a後面跟著零個或者一個b
Ex: “a”,”ab”
[] [13579] 方括號表示某些字元允許在一個字串中的某一特定位置出現。
包含 "1" 或 "3" 或 "5" 或 "7" 或 "9" 的字串。
Ex: "a3b", "1xy"
[0-9]   含數字之字串
[^0-9]   不含數字之字串
[a-z0-9]   含數字及小寫字母之字串
[^a-z0-9]   不含數字及小寫字母之字串
[a-zA-Z0-9]   含數字或字母之字串
[^a-zA-Z0-9]   不含數字及字母之字串
b[aeiou]t   "bxt", "bzt","bat", "bet", "bit", "bot", "but"
^[a-zA-Z]   表示一個以字母開頭的字串
[0-9]%   表示一個百分號前有一位元的數位
[a-zA-Z0-9]$   表示一個字串以一個逗號後面跟著一個字母或數位結束
{} ab{2} 用以表示重復次數的範圍。
表示一個字串有一個a跟著2個b。
Ex: "abb"
ab{2,}   表示一個字串有一個a跟著至少2個b
ab{3,5}   表示一個字串有一個a跟著3到5個b
字串位置
^ ^xy 以 "xy" 開始的字串
Ex: "xyz", "xyab"
$ xy$ 以 "xy" 結尾的字串
Ex: 例如:"axy", "abxy"
%[^a-zA-Z]%   兩個百分號中不應該出現字母
[aeiouAEIOU]   含母音之字串
[^aeiouAEIOU]   不含母音之字串
[^\^]   不含 "^" 之字串,例如:"xyz", "abc"
特殊字元
\d   數字0~9
\D   非數字
\w   數字、字母、底線
\W   非 \w
\s   空白字元 + \r\t\n\f
\S   非 \s
| (b|cd)ef 表示”或”
"bef"或"cdef"
\ ^\^ 跳脫字元,將特殊符號的義意去除,^.$()|*+?{\"這些字元前加上跳脫字元'\'
字首必須是^
  • Keywords : 字串, 字母, a後面, 字元, 多字元, 含數字, 例如, aeiouAEIOU, 非數字, 重覆字串, 重復, 逗號後面, 跳脫字元, 若干, 至少一, 至少2, 者一, 義意去除, 結尾, 範圍
0 0
2010-05-22T09:09:00+0000


  • Now, you can post comments by Facebook Account when your Yampiz account was logout or unvariable. whatever, we suggest to post comment by Yampiz Account to get more bounds to join new events of Heyxu
Comment
 
Verify

Facebook Page

QR-Code and APP Launcher

User Guide
This Webpage

In those service tabs, "Scan QRCode, in mobile device" or "Click the button, in this device" to open webpage or APP-related operations.
QRCode
  • Auto Platform
    For better browsing experience, it will auto detects your device to display webpage.
  • Bug Report
    Tell us about the idea, problem and errors you found.
  • Comodo Secure
    The sensitive data transmission adopts by SSL-2048 authenticated encryption.
  • Copyright
    © 2009 YamPiz Digital Inc. & Jaby Group. All rights reserved.
  • Revised Version
    V2.2.061
    03 Aug 2023 (GMT+8)