I’m banging my head against a wall with a regular expression. I’m trying to define an expression that excludes exactly this text ‘System’ (case insensitive), but can contain
the word ‘System’ providing it’s not just that.
Examples:
- System == INVALID
- SYSTEM == INVALID
- system == INVALID
- syStEm == INVALID
- asd SysTem == Valid
- asd System asd == Valid
- System asd == Valid
- asd System == Valid
- asd == Valid
Try this:
Or this to match the whole line:
The regex has a negative look-ahead on its beginning, which doesn’t match if “system” is the entire string.