I use this regex to extract all lines starting with ' { ' and ending with ' } '

Code

push (@matches,$&) while($line =~ /{(.*?)}/g );

Now I'd like to exclude lines that contains a ' * ' I've already tried several options (also used the Perl Regular Expression Quick Reference Card) I assume I need to use ' ^ but can't get it done. Please help

I'm reading a text file line by line. If a line matches a pattern, I use the regex to extract the sub string between the curly brace (sometimes more than one per line) But if there's an asterisk between the curly brace, I need to ignore that one. When it matches the regex I need to do some further processing (JSON and write results to another file)

So I can't simply ignore the one with an asterisk.

Do I need to use a second regex before further processing or is it possible to create a suitable regex to do both at the same time ?

The second regex just checks whether "*" is contained in your capture. The $1 and $1 !~ /\*/ notation just makes sure that you did, in fact, capture something, since you could 'capture' an empty string between "{}" and it would be true that "*" isn't within "".