Regex match outer nested tags

前端 未结 4 1957
走了就别回头了
走了就别回头了 2021-01-16 03:43

I have this string

blabla [IC=\"test\"]Hello, [IC=\"testing\"] this is a nested tag [EC], cya.[EC] blabla

I\'m trying to match the outer [

4条回答
  •  滥情空心
    2021-01-16 04:13

    Try this:

    (\[IC="\w*"\].*\[EC\])
    

    https://regex101.com/r/MVU9ni/1

    Matches 0 or more characters that are located in between [IC="any_word_character_here"] and [EC].

提交回复
热议问题