Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: Regex brain failure  (Read 156 times)

Weaver

  • Addicted Kitizen
  • *****
  • Posts: 6565
  • Retd sw dev; A&A; 4 × 7km ADSL2; IPv6; Firebrick
Regex brain failure
« 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’.)
Logged