regex to find a string that comes after =

前端 未结 6 1231
萌比男神i
萌比男神i 2021-01-28 07:15

I´m really new to regex and I have been looking around to find an answer but either it dont work or I get some kind of error so I will try to ask the question and hopefulyl some

6条回答
  •  逝去的感伤
    2021-01-28 07:43

    I think this should work :

    ([^[]+)(?:\[[^=]+=([^\]]+)\])+
    

    Explainations :

    ([^[]) First, you match everything that is not a [.

    (?:...)+ Then, when you find it, you're starting repeting a pattern

    \[[^=] Find everything that is not an =, and discard it.

    ([^\]]) Find everything that is not a ] and capture it.

提交回复
热议问题