V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
PeterD
V2EX  ›  问与答

在vim下怎么复制正则表达式匹配的内容?

  •  
  •   PeterD · Apr 28, 2013 · 3746 views
    This topic created in 4759 days ago, the information mentioned may be changed or developed.
    比如,我想复制下面所有的 <p>.*</p>

    anything google <p>this is sentence 1.</p>
    anything git <p>this is sentence 2.</p>
    anything py <p>this is sentence 3.</p>
    this is a break.
    anything v2ex <p>this is sentence 4.</p>

    复制的输出要是:

    <p>this is sentence 1.</p>
    <p>this is sentence 2.</p>
    <p>this is sentence 3.</p>
    <p>this is sentence n.</p>

    ------------
    有什么命令可以解决吗?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3208 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:56 · PVG 18:56 · LAX 03:56 · JFK 06:56
    ♥ Do have faith in what you're doing.