I have rows with different sets of parenthesis. For example
(sdfsfs) (sfdsfd) (sdfsfs) (sfdsfd) (sfdsfd) (sdfsfs) (sfdsfd) (sfdsfd) (sfdsfd)
You can use this regex to match a line with exactly 2 parentheses sets:
m/^(\([^)]*\)\s*){2}$/
OR:
m/^\([^)]*\)\s*\([^)]*\)$/
RegEx Demo
[^)]* will match any character but ) and is more efficient than .*? or .*.
[^)]*
)
.*?
.*