How-to articles, tricks, and solutions about REGEX
Java string split with "." (dot)
To split a string in Java using a dot (.) as the delimiter, you can use the split method of the String class.
Java; String replace (school project)?
To replace a substring in a string in Java, you can use the replace() method of the String class.
PHP Regex to get youtube video ID?
You can use the following regular expression to extract the YouTube video ID from a URL:
PHP string "contains"
To check if a string contains another string in PHP, you can use the strpos() function.
PHP/regex: How to get the string value of HTML tag?
In PHP, you can use the preg_match() function to extract the string value of an HTML tag.
Python string.replace regular expression
You can use the re module in Python to use regular expressions with the replace() method.
Regex pattern including all special characters
To create a regular expression that includes all special characters, you can use the following pattern:
Remove all non-numeric characters from a string; [^0-9] doesn't match as expected
You can use the preg_replace function in PHP to remove all non-numeric characters from a string.
Remove all special characters, punctuation and spaces from string
Here is an example of code that removes all special characters, punctuation, and spaces from a string in Python: