Posts marked with "RegEx" in categories

How To Create A Simple Password Strength Checker In jQuery

A lot of new hacking methods are coming day by day. So it’s the programmers duty to make their user’s password secure. Here is a simple Password Strength Checker created using jQuery. The code contain a function got from WordPress (I modified it) which is the core component of the checker. This checker will check the following on the password : Have minimum value of 4 characters. Whether the username matches with password Whether the password contain small a-z characters and capital A-Z characters.... [READ MORE]

Create Your Own URL Shortening Service Using PHP & jQuery

I made a URL shortening service a year back using PHP & jQuery. It was pretty simple. You should know the concept of URL Shortening. The concept is simple. When a user sends a request to short a URL, PHP will check if the URL is valid. If it’s valid then PHP will make a string of 5 or 6 characters. A folder is created with the name of this string and an index.php file with header function code is created in this folder.... [READ MORE]

Using Regex to validate E-mail and Phone Number

Here is the RegEx expression to validate Phone number and E-mail. RegEx expression for validating E-mail : /^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/ and the RegEx expression for validating Phone number : /^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/ Here is an example of usage of these RegEx expressions in JavaScript. var emailregex=/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;var phoneregex=/^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;if (emailregex.test(string)){// valid email}else{// Invalid email}if (phoneregex.test(string)){// valid phone number}else{// Invalid phone number} You can replace string with whatever you want. For Example: if (phoneregex.test($("#phone").val())){// valid phone number}else{// Invalid phone number} Enjoy !... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab