bootislands
V2EX  ›  问与答

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

  •  
  •   bootislands · Sep 14, 2012 · 3828 views
    This topic created in 5185 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
    skydiver
    Sep 14, 2012❤️1
    1
    试试(…)+
    bootislands
    bootislands
    OP
    Sep 15, 2012
    2
    @skydiver 谢谢,真是隔着一层纸
    yangg
    yangg
    Sep 15, 2012
    3
    1L的不对吧,意义完全不一样了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2421 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 11:41 · PVG 19:41 · LAX 03:41 · JFK 06:41
    ♥ Do have faith in what you're doing.