# NSString-STRegex **Repository Path**: yanglishuan/NSString-STRegex ## Basic Information - **Project Name**: NSString-STRegex - **Description**: 一些正则校验,判断邮箱,手机号码,车牌号,身份证号,网址,账号,密码,ip,去掉html格式,工商税号等。 - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 498 - **Forks**: 130 - **Created**: 2014-01-15 - **Last Updated**: 2025-02-10 ## Categories & Tags **Categories**: ios-modules **Tags**: None ## README # NSString+STRegex 一些正则校验,判断邮箱,手机号码,车牌号,身份证号,网址,账号,密码,ip,去掉html格式,工商税号等。 ![image](http://git.oschina.net/yanglishuan/NSString-STRegex/raw/master/ScreenShots/screenshot1.png) ![image](http://git.oschina.net/yanglishuan/NSString-STRegex/raw/master/ScreenShots/screenshot2.png) ![image](http://git.oschina.net/yanglishuan/NSString-STRegex/raw/master/ScreenShots/screenshot3.png) ``` // 判断邮箱 isValid = [text isValidEmail]; // 判断手机号码 isValid = [text isValidPhoneNum]; // 判断ip isValid = [text isValidIP]; // 判断身份证号 isValid = [text isValidIdCardNum]; // 判断账号 isValid = [text isValidWithMinLenth:4 maxLenth:12 containChinese:NO firstCannotBeDigtal:YES]; // 去掉html格式 text = [text removeHtmlFormat]; // 工商税号 isValid = [text isValidTaxNo]; ``` 注:其中身份证号验证由张衎友情提供,工商税号验证由[beiliubei](http://git.oschina.net/beiliubei) 提供,在此表示感谢。