I have this regex
@(.*)\((.*)\)
And I'm trying to get two matches from this string
@YouTube('dqrtLyzNnn8') @Vimeo('124719070')
I need it to stop after the closing )
, so I get two matches instead of one.
I have this regex
@(.*)\((.*)\)
And I'm trying to get two matches from this string
@YouTube('dqrtLyzNnn8') @Vimeo('124719070')
I need it to stop after the closing )
, so I get two matches instead of one.
Your regex is trying to eat as much characters as possible. Look at the next regex:
echo "@YouTube('dqrtLyzNnn8') @Vimeo('124719070')" |
sed 's/@[a-zA-Z]*(\([^)]*\)[^@]*@[a-zA-Z]*(\([^)]*\).*/\1 \2/'
I do not know the exact requirements, you might me easier of starting with another command:
echo "@YouTube('dqrtLyzNnn8') @Vimeo('124719070')" | cut -d\' -f2,4