Structures

The following structures are available globally.

  • Create a regular expression from a pattern string and options.

    import Regex
    
    let regex = Regex(#"^[a-z]+$"#, options: .caseInsensitive)
    
    regex.isMatched(by: "Unicorn")
    //=> true
    
    See more

    Declaration

    Swift

    public struct Regex : Hashable