美文网首页
NSRegularExpression 使用

NSRegularExpression 使用

作者: chaochaoMaiTian | 来源:发表于2018-02-28 00:24 被阅读0次

    NSRegularExpression 使用

    NSRegularExpression是正则表达式的专用类,其他的还有

    1.NSString的:rangeOfString:option:是直接查找。

    2.NSPredicate谓词匹配


    enum {     

    NSRegularExpressionCaseInsensitive            = 1 << 0,  // 不区分大小写的      NSRegularExpressionAllowCommentsAndWhitespace  = 1 << 1,  // 忽略空格和# -      NSRegularExpressionIgnoreMetacharacters        = 1 << 2,  // 整体化      NSRegularExpressionDotMatchesLineSeparators    = 1 << 3,  // 匹配任何字符,包括行分隔符     

    NSRegularExpressionAnchorsMatchLines          = 1 << 4,  // 允许^和$在匹配的开始和结束行     

    NSRegularExpressionUseUnixLineSeparators      = 1 << 5,  // (查找范围为整个的话无效)     

    NSRegularExpressionUseUnicodeWordBoundaries    = 1 << 6    // (查找范围为整个的话无效)   

    };      typedef NSUInteger NSRegularExpressionOptions;

    (http://|https://)[^\"]+(.png|.jpg) 图片正则

    相关文章

      网友评论

          本文标题:NSRegularExpression 使用

          本文链接:https://www.haomeiwen.com/subject/egobwxtx.html