How-to articles, tricks, and solutions about REGEX
Allow only [a-z][A-Z][0-9] in string using PHP
You can use the preg_replace function in PHP to remove any characters that do not match the specified pattern.
Check and extract a number from a String in Java
To check if a string contains a number and extract the number from the string in Java, you can use a combination of the matches method of the String class and the find method of the Matcher class.
Convert plain text URLs into HTML hyperlinks in PHP
You can use the preg_replace() function in PHP to convert plain text URLs into HTML hyperlinks.
Function to return only alpha-numeric characters from string?
To return only alpha-numeric characters from a string in PHP, you can use the preg_replace function with a regular expression pattern that matches any non-alphanumeric character.
How to add http:// if it doesn't exist in the URL
You can use the following code snippet to add "http://" to the beginning of a URL if it doesn't already exist:
How to Compare Strings in Java
The comparison of strings is one of the mostly used Java operations. If you’re looking for different ways to compare two strings in Java, you’re at the right place.
How to Count String Occurrence in String
Read this tutorial and learn several useful methods that are used to count the string occurrence in a string. Choose one of the working methods for you.