RadishWind
V2EX  ›  问与答

PHP / Python 如何批量匹配正则表达式?

  •  
  •   RadishWind · Apr 7, 2017 · 3202 views
    This topic created in 3372 days ago, the information mentioned may be changed or developed.

    我在写一个功能型的聊天机器人,想用正则提取用户所说的关键词:

    例如 [ '\d+' => deal_num(), '\w+' => deal_word() ] 请问有没有比遍历数组更好的办法?

    2 replies    2017-04-08 07:11:54 +08:00
    hikkikuma1991
        1
    hikkikuma1991  
       Apr 7, 2017
    ac 自动机
    RadishWind
        2
    RadishWind  
    OP
       Apr 8, 2017 via iPhone
    @hikkikuma1991 💡谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3273 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 11:30 · PVG 19:30 · LAX 04:30 · JFK 07:30
    ♥ Do have faith in what you're doing.