Skip to content

Regular expression with ^ not recognized #160

Description

@alberti42

Thank you for the amazing ST4 package. It is super useful. I encountered issues with the default definition for Objective-C files:

{
            "syntax": "Objective-C/Objective-C",
            "match": "all",
            "rules": [
                {"globmatch": "**/*.m"},
                {"contains": "^\\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\\b|#import\\s+.+\\.h[\">])"}
            ]
        },

where I had to change the rule contains to:

{"contains": "\\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\\b|#import\\s+.+\\.h[\">])"}

There, I removed ^ and it then worked. Do you know a simple explanation why ^ is not accepted? I checked with my .m files and the rule including ^ results in positive matches when using regex search functionality of ST4 editor. So, the problem should not be with my .m files.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: triageIssue needs triage.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions