bootislands
V2EX  ›  问与答

[求教]正则表达式对中文字符的贪婪匹配

  •  
  •   bootislands · Sep 14, 2012 · 3504 views
    This topic created in 5015 days ago, the information mentioned may be changed or developed.
    UltraEdit的Perl引擎下:
    以a+匹配aaa,匹配结果是aaa
    以…+匹配………,匹配结果却是…

    为什么第二种情况不贪婪了?有办法匹配尽量多的某个中文字符吗?
    3 replies    1970-01-01 08:00:00 +08:00
    skydiver
        1
    skydiver  
       Sep 14, 2012   ❤️ 1
    试试(…)+
    bootislands
        2
    bootislands  
    OP
       Sep 15, 2012
    @skydiver 谢谢,真是隔着一层纸
    yangg
        3
    yangg  
       Sep 15, 2012
    1L的不对吧,意义完全不一样了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2102 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 16:13 · PVG 00:13 · LAX 09:13 · JFK 12:13
    ♥ Do have faith in what you're doing.