orbwalker
V2EX  ›  问与答

操作文本数据用什么最方便?

  •  
  •   orbwalker · Jun 17, 2019 · 1571 views
    This topic created in 2548 days ago, the information mentioned may be changed or developed.

    文本内容:宠物礼盒----4444006。。。。。。。。替换需求:将 4444006 与 宠物礼盒 调换一下。。。。。。。。请问:能否用正则表达式操作? Java 与 Python 都需要 IO 操作。

    Sylv
        1
    Sylv  
       Jun 17, 2019   ❤️ 2
    Sublime Text 正则替换下就行:
    Find: ^(.+?)(-+)(.+)$
    Replace: \3\2\1
    lyy16384
        2
    lyy16384  
       Jun 17, 2019
    替换跟 IO 操作没关系啊,如果你的内容在文件里当然要 IO 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4746 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 167ms · UTC 09:58 · PVG 17:58 · LAX 02:58 · JFK 05:58
    ♥ Do have faith in what you're doing.