chuxuezhe
V2EX  ›  问与答

求正则表达式

  •  
  •   chuxuezhe · Sep 22, 2015 · 2821 views
    This topic created in 4061 days ago, the information mentioned may be changed or developed.

    字符串如下
    key: 5_53;E(g5g5rdd[w&Pygg As

    需要正则匹配 key: 和 As 中间的,除了空格什么字符都有可能出现
    求正则表达式

    6 replies  •  2015-09-22 14:28:23 +08:00
    explon
    explon
    Sep 22, 2015
    1
    按照空格分割成数组取 key: 与 As 之间的不就好了?
    chuxuezhe
    chuxuezhe
    OP
    Sep 22, 2015
    2
    两头还有其他的单词
    suduo1987
    suduo1987
    Sep 22, 2015 via iPhone
    3
    代码混淆?
    aa45942
    aa45942
    Sep 22, 2015
    4
    (?<=^key:).*(?=As$)
    b821025551b
    b821025551b
    Sep 22, 2015
    5
    key:(.*)As
    freedomSky
    freedomSky
    Sep 22, 2015
    6
    key: \([^ ]*\) As
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2508 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 14:56 · PVG 22:56 · LAX 06:56 · JFK 09:56
    ♥ Do have faith in what you're doing.