Verify e-mail? Phone number? Password 6-15 bit? Verify input URL? ID number? File name change? Replace a string part of a word?

Source: Internet
Author: User

/*** Verification email? Phone number? Password 6-15-bit? Verify the input URL? * Email address: * "[\\w]@[\\w] (. \\w+) +";*/ Public classStringDemo8 { Public Static voidMain (string[] args) {String email= "[Email protected]"; String Emailregex= "[\\w][email protected][a-za-z0-9]+ (. \\w+) +"; String Pwdregex= "[\\w]{6,15}"; String pwd= "a_34625"; String Idregex= "[2] ([\\d]{17}|[ \\d]{14}| [\\d] {16} [XX]) "; String ID= "21010219880313212X"; String jpgimg= "Mqh.jpg"; String Jpgregex= "\\.";        System.out.println (Email.matches (Emailregex));        System.out.println (Pwd.matches (Pwdregex));        System.out.println (Id.matches (Idregex)); //Small application of automatic file name changestring[] NewName =Jpgimg.split (Jpgregex); Jpgimg= System.currenttimemillis () + "." +newname[1];        System.out.println (JPGIMG); //The application of the method of replacing curse swearingString fuck = "I want to say: Cnm,fuck DSB"; String Fuckregex= "fuck| SB|CNM|DSB "; Fuck= Fuck.replaceall (Fuckregex, "* * *");    System.out.println (Fuck); }}
View Code

Verify e-mail? Phone number? Password 6-15 bit? Verify input URL? ID number? File name change? Replace a string part of a word?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.