Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.08 KB

README.md

File metadata and controls

33 lines (18 loc) · 1.08 KB

XYQRegexPattern

  正则表达式(因为正则表达式比较常用,所以列出其中常用的式子、当然支持自定义正则表达式)

How to user api

CocoaPods支持

    pod 'XYQRegexPattern', '~> 2.0.0'     image

1、类方法,演示如下:

#import "XYQRegexPatternHelper.h"

NSLog(@"%d",[XYQRegexPatternHelper validateBankCardNumber:@"62218849800236153"]);

NSLog(@"%d",[XYQRegexPatternHelper validateEmail:@"[email protected]"]); 

NSLog(@"%d",[XYQRegexPatternHelper validateCustomRegex:@"^[\u4E00-\u9FA5]*$" TargetString:@"我只是中文"]);

2、实例方法,演示如下:

#import "XYQRegexPatternHelper.h"

XYQRegexPatternHelper *hepler = [[XYQRegexPatternHelper alloc] init];

NSLog(@"%d",[hepler validateIsValidQQ:@"1383478"]);        

NSLog(@"%d",[hepler validateIsValidMailbox:@"[email protected]"]);

NSLog(@"%d",[hepler validateCustomRegex:@"^[\u4E00-\u9FA5]*$" TargetString:@"我只是中文"]);