I have an expression like:
ENTITY first
VHDL language standard: 3 (VHDL-2008)
ARCHITECTURE BODY arch
VHDL language standard: 3 (VHDL-2008)
Now I want a regexp for only the first paranthesis after ENTITY
so the result should be VHDL-2008
or even 2008
.
I'm new to regexps. What I tried:
"^ENTITY *(.*)"
only returns "first". So my question is: How can I request a newline after "first"? My try:
"^ENTITY .*\\n(.*)"
And very confusing was the result of
"^(.*)"
which added some { and }. Why?
I have found a very ugly way to do this:
first eliminate newlines
set data [regsub -all "\n" $data ""]
and then something like this:
{ENTITY risc .*VHDL language standard: [0-3]..VHDL-(.*).}
As you can see I didn't understand how to recognize { or ( paranthesis. Any better solution?