GromHellscream

[^=]+$ 这个正则该怎么理解?

  •  
  •   GromHellscream · Jun 4, 2020 · 2540 views
    This topic created in 2186 days ago, the information mentioned may be changed or developed.
    我的理解是这样:
    1. $ 表示从输入的结尾开始匹配
    2. + 表示前面匹配的项可以出现一次或多次
    3. [^=] 表示匹配所有非 = 的内容

    请问大家,我这样的理解对吗?谢谢
    8 replies    2020-06-05 07:37:56 +08:00
    vibbow
        1
    vibbow  
       Jun 4, 2020
    [^=]+$
    ------

    [^=]+$

    Options: Case sensitive; Exact spacing; Dot doesn’t match line breaks; ^$ don’t match at line breaks; Greedy quantifiers; Regex syntax only

    * [Match any character that is NOT a “=”][1] `[^=]+`
    * [Between one and unlimited times, as many times as possible, giving back as needed (greedy)][2] `+`
    * [Assert position at the end of the string, or before the line break at the end of the string, if any (line feed)][3] `$`

    Created with [RegexBuddy]( https://www.regexbuddy.com/)

    [1]: https://www.regular-expressions.info/characters.html
    [2]: https://www.regular-expressions.info/repeat.html
    [3]: https://www.regular-expressions.info/anchors.html
    vibbow
        2
    vibbow  
       Jun 4, 2020
    说好的可以贴 MD 格式呢。。。
    GromHellscream
        4
    GromHellscream  
    OP
       Jun 5, 2020
    @vibbow 谢谢老哥,这软件真好,可惜 win 限定。
    那根据这内容,我的理解是对的喽?
    GromHellscream
        5
    GromHellscream  
    OP
       Jun 5, 2020
    @vibbow 再次感谢,这 regular-expressions.info 网站真好,谢谢
    ulala
        6
    ulala  
       Jun 5, 2020 via iPad
    @GromHellscream 就是匹配开头不是等号的非空行。
    ulala
        7
    ulala  
       Jun 5, 2020 via iPad
    哦,不对,是不以等号结尾的非空行,匹配该后缀
    jxie0755
        8
    jxie0755  
       Jun 5, 2020 via iPhone
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2569 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 01:12 · PVG 09:12 · LAX 18:12 · JFK 21:12
    ♥ Do have faith in what you're doing.