what's the regular expression to find two sets of parenthesis in a row using perl?

前端 未结 3 1193
我在风中等你
我在风中等你 2021-01-23 09:26

I have rows with different sets of parenthesis. For example

     (sdfsfs) (sfdsfd) 
     (sdfsfs) (sfdsfd) (sfdsfd) 
     (sdfsfs) (sfdsfd) (sfdsfd) (sfdsfd)
            


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-23 09:35

    ^(?:\s*\([^\)(]*\)\s*){2}$
    

    You can define this pattern with anchors.See demo.

    https://regex101.com/r/eX9gK2/10

提交回复
热议问题