I've created regex to determine if a class has an empty line following it. When searching in xcode, this works perfectly. However, swiftlint does not seem to work properly.
Rule is:
custom_rules:
space_after_class:
name: "No Space After Class"
message: "Empty line required after class declarations"
regex: '(^(open|internal|private|public)*class\s(?!func).*\{$\n(?!^\s*$))'
severity: error
This works fine when searching in xcode/sublime/whatever, but for some reason in swiftlint all class declarations are returned (even those with a new line)
Example of rule (notice the blank line- this is not found by the same regex using ctrl+f):
What is different about the swiftlint regex that causes this?