📘
Luckydesigner
  • Knowledge Code Guide
  • HTML CODE
    • Dictionary
  • CSS CODE
    • Dictionary
  • Javascript Code
    • Dictionary
    • Examples
    • Reference
  • Regular Expressions
    • Reference
  • Wechat Mini Program Develop Notes
    • 开篇
    • 流程
    • 构成
      • 框架
    • 配置
      • index.wxml+index.js
      • Button
      • UserInfo
      • TabBar
      • Clipboard
    • Api
      • 背景
      • 交互
      • 导航栏
    • 标签
Powered by GitBook
On this page

Was this helpful?

  1. Regular Expressions

Reference

Name

Description

Example

g

global boundary

/[a-z]/g

globle

test g is or not

i

case-insensitive

/[a-z]/i

ignoreCase

test i is or not

.

any character except newline

/*/

\w

word equal to [A-z]

/\w/

\W

not word equal to []*%$@# etc

/\W/

\d

digit equal to [0-9]

/\d/

\D

not digit equal to anything except for [0-9]

/\D/

\s

whitespace

/\s/

\S

not whitespace

/\S/

[ABC]

select A, B or C; if it's [D], select D

/[ABC]/

[^ABC]

not select A, B or C; select others

/[^ABC]/

\b

select a word the last alphabet

/ed\b/

\D

select a word not the last alphabet

/ed\D/

^

start

/^ed/

$

end

/ed$/

PreviousReferenceNext开篇

Last updated 4 years ago

Was this helpful?