How to validate HTML tag using Regular Expression
Given string str, the task is to check whether it is a valid HTML tag or not by using Regular Expression.The valid HTML tag must satisfy the following conditions:...
read more
How to check if string contains only digits in Java
Given string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then print true, otherwise false....
read more
Check if an URL is valid or not using Regular Expression
Given a URL as a character string str of size N.The task is to check if the given URL is valid or not.Examples :...
read more
Split() String method in Java with examples
The string split() method breaks a given string around matches of the given regular expression. After splitting against the given regular expression, this method returns a string array....
read more
How to Remove All Punctuation from a String using Regex in Java?
In this article, we will explain how to remove all punctuation from a given String by using Java with the help of Regex. Here regex means regular expression. The regex is a powerful way to explain the search pattern. One more thing is that regular expressions are mostly used for Searching a required pattern, and matching the pattern and the other one is Manipulating text based on the required pattern....
read more
How to Replace the First Occurrence of a String Using Regex in Java?
Regex is a very interesting way to search for patterns in a String that the user provides. Regex stands for Regular Expressions. It consists of some patterns that can be planned and modified according to the usage of the program....
read more
Java Program to Find Occurrence of a Word Using Regex
Java’s regular expressions, or regex, let you do advanced text manipulation and matching. Regex offers a handy approach for searching for a term in a text wherever it appears. In this article, we will learn to find every occurrence of a word using regex....
read more
How to check Aadhaar number is valid or not using Regular Expression
Given string str, the task is to check whether the given string is a valid Aadhaar number or not by using Regular Expression. The valid Aadhaar number must satisfy the following conditions:...
read more
Pattern toString() Method in Java with Examples
toString() method of a Pattern class used to return the string representation of this pattern. This return the regular expression from which this pattern was compiled....
read more
Check if URL is valid or not in Java
Given a URL as string, we need to find if the given URL is valid or not....
read more
Pattern quote(String) method in Java with Examples
quote(String) method of a Pattern class used to returns a literal pattern String for the specified String passed as parameter to method.This method produces a String equivalent to s that can be used to create a Pattern. Metacharacters or escape sequences in the input sequence will be given no special meaning. If you compile the value returned by the quote method, you’ll get a Pattern which matches the literal string that you passed as a parameter to method.\Q and \E mark the beginning and end of the quoted part of the string. Syntax:...
read more
How to Make Java Regular Expression Case Insensitive in Java?
In this article, we will learn how to make Java Regular Expression case-insensitive in Java. Java Regular Expression is used to find, match, and extract data from character sequences. Java Regular Expressions are case-sensitive by default. But with the help of Regular Expression, we can make the Java Regular Expression case-insensitive. There are two ways to make Regular Expression case-insensitive:...
read more