how to use regular expressions in yii
2014-03-20 22:59
609 查看
http://stackoverflow.com/questions/20455022/how-to-use-regular-expressions-in-yii
You can try to use
rule to validate the attribute value with the specific regular expression like:
You can try to use
match(CRegularExpressionValidator)
rule to validate the attribute value with the specific regular expression like:
public function rules() { return array( array('username, password', 'required'), array( 'username, password', 'match', 'pattern' => '/^[\*a-zA-Z0-9]{6,14}$/', 'message' => 'Invalid characters in username or password.', ), ); }
相关文章推荐
- How to use regular expressions in Notepad++ (tutorial)
- How to use Regular Expression in LotusScript
- [Yii Framework] How to run cron job (or use command) in the server with yii framework
- How to Use Lambda Expressions in a Query
- Regular Expression in C# - How to make use of Expresso
- How to use HttpWebRequest and RegularExpressions to crash website
- How to use CSRF in Yii automatic.与csrf token 无法被验证
- [Yii Framework] How to use CSRF in Yii automatic.
- How To Use Git Source Control with Xcode in iOS 7
- What is reflection and how to use it in CSharp ?
- How to Use the restrict Qualifier in C
- [转]How to use String.Format in PowerShell?(如何在PowerShell中使用string.format?)
- How to use SET in python
- How to use interfaces in Go
- How to use Pageheap.exe in Windows XP, Windows 2000, and Windows Server 2003
- 如何在python中使用*args,**kwargs (How to use *args and **kwargs in Python)
- 如何在Vista中使用MMC方式的Remote Desktops(How to use Remote Desktops through mmc console in Vista)
- how to use DelayedExpansion in batch
- How to make a USB stick use ISO image file in debian
- How to Reference and Use JSTL in your Web Application