zoukankan      html  css  js  c++  java
  • regex

    Regular Expression Basics
    . Any character except newline
    a The character a
    ab The string ab
    a|b a or b
    a* 0 or more a's
    Escapes a special character
    Regular Expression Quantifiers
    * 0 or more
    + 1 or more
    ? 0 or 1
    {2} Exactly 2
    {2, 5} Between 2 and 5
    {2,} 2 or more
    Default is greedy. Append ? for reluctant.
    Regular Expression Groups
    (...) Capturing group
    (?:...) Non-capturing group
    Y Match the Y'th captured group
    Regular Expression Character Classes
    [ab-d] One character of: a, b, c, d
    [^ab-d] One character except: a, b, c, d
    [] Backspace character
    d One digit
    D One non-digit
    s One whitespace
    S One non-whitespace
    w One word character
    W One non-word character
    Regular Expression Assertions
    ^ Start of string
    $ End of string
     Word boundary
    B Non-word boundary
    (?=...) Positive lookahead
    (?!...) Negative lookahead
    Regular Expression Flags
    g Global Match
    i Ignore case
    m ^ and $ match start and end of line
    Regular Expression Special Characters
    Newline
    Carriage return
    Tab
    Null character
    YYY Octal character YYY
    xYY Hexadecimal character YY
    uYYYY Hexadecimal character YYYY
    cY Control character Y
    Regular Expression Replacement
    $$ Inserts $
    $& Insert entire match
    $` Insert preceding string
    $' Insert following string
    $Y Insert Y'th captured group

    https://www.debuggex.com/cheatsheet/regex/javascript

  • 相关阅读:
    MVC 后台DataTable 前台遍历
    oracle 创建表空间详细介绍
    C# Chart 折线图 多条数据展示
    ASP.NET Request.QueryString 出现乱码问题
    生成XML文件
    什么是Intent(意图)
    HTTP错误405-Method Not Allowed
    通过剪切板传递数据—— 传递一个对象
    Linux下crontab命令的用法
    Redis使用介绍
  • 原文地址:https://www.cnblogs.com/Searchor/p/13467916.html
Copyright © 2011-2022 走看看