Snippets tagged “regular-expressions”
12 snippets use this tag.
- Deprecated: Function split() is deprecated. How to fix this statement?PHP
The split() function is deprecated, which means it is no longer supported and should not be used in new code.
- Determine if a String is an Integer in JavaJava
To determine if a string is an integer in Java, you can use the isDigit() method of the Character class to check if each character in the string is a digit. Here's an example:
- Getting title and meta tags from external websitePHP
In PHP, you can use the file_get_contents() function to retrieve the HTML code of a website, and then use regular expressions or a DOM parsing library to extract the title and meta tags.
- How do I split a string into a list of words?Python
Here is an example of how to split a string into a list of words in Python:
- How to Change an Element’s Class with JavaScriptJavaScript
One of the most common issues in JavaScript is changing an element’s class. In this snippet, we are going to show you the efficient ways of achieving it.
- How to extract numbers from a string in Python?Python
In Python, you can use regular expressions to extract numbers from a string.
- How to match whitespace, carriage return and line feed using regular expression in PHP?PHP
In PHP, you can match whitespace, carriage return, and line feed using the following regular expression:
- How to Replace All Occurrences of a String in JavaScriptJavaScript
On this page, you can find the fast-solutions on how to replace all the occurrences of a string in JavaScript. Read it and find the simplest solution.
- How to Validate URL with PHPPHP
In this snippet, we provide guidelines on one of the most common issues in PHP. Here, we show the most straightforward way on how to validate URL with PHP.
- PHP: Best way to extract text within parenthesis?PHP
There are a few different ways to extract text within parentheses in PHP, depending on the specific requirements of your use case.
- Remove specific characters from a string in PythonPython
In Python, you can remove specific characters from a string by using the replace() method or using string slicing and concatenation.
- What is the best Java email address validation method?Java
There are a few different approaches you can take to validate email addresses in Java. Here are some options: