Kitz Forum

Chat => Tech Chat => Topic started by: Weaver on September 22, 2018, 10:55:48 AM

Title: Regex brain failure
Post by: Weaver on September 22, 2018, 10:55:48 AM
I want to parse a text file on the cheap and thought I could perhaps use a regex, but brain failure today.
Case 1:
Code: [Select]
Blah
$$ If cond
Jam sandwiches
$$ If cond

Case 2:
Code: [Select]
Blah
$$ If cond
Jam sandwiches
$$ EndIf
Pickled eggs
$$ If cond

I want to detect case 1 and not match case 2. (It is because I have not written the proper code yet to handle nested ifs so wanted a quick warning to say, ‘not yet supported’.)