I am attempting to match #if macro do #end
from the following:
class OtherClass {}
class MyClass<T:{T_1,T_2}> #if macro do #end {}
<T:{T_1,T_2}>
illustrates the character set inbetween the string class
and #if macro do #end
The problem is, if you use the dot or an applicable character set, you are going to match from OtherClass. So presumably something like this is in order:
(.(?!class))+?)
I haven't seen something like this widely discussed. It matches on a test case, but it appears to cause a pcre_exec error on content that it doesn't actually match. Perhaps there is a lot of backtracking going on. Any suggestions on how to resolve this assuming that an applicable character set [a-zA-Z0-9_,\.{}<>]
would in fact match from a previous class declaration. Let us presume that it is not possible to solve this with character limit hacks.