Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 2160 of 3366
1K+ Views
Since the year 2002, an amazing tool is being used by many organizations for issue tracking, bug tracking, and project management functions. Yes, you are right! we are talking about Jira software. Jira is a popular issue tracking and project management tool developed by Atlassian.History behind the NameYou may be aware that Jira is not an acronym; actually, it is a part of the word “Gojira” which means Godzilla in the Japanese language.Later, as many organizations moved towards agile processes and practices, the popularity of Jira software increased to manifolds. That’s because Jira software has many supporting features to the ... Read More
297 Views
Following regular expression matches given e-mail id including the blank input −^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2, 6})?$Where, ^ matches the starting of the sentence.[a-zA-Z0-9._%+-] matches one character from English alphabet (both cases), digits, "+", "_", ".", "" and, "-" before the @ symbol.+ indicates the repetition of the above mentioned set of characters one or more times.@ matches itself[a-zA-Z0-9.-] matches one character from English alphabet (both cases), digits, "." and "-" after the @ symbol\.[a-zA-Z]{2, 6} two to 6 letter for email domain after "."$ indicates the end of the sentenceExample 1 Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SampleTest { public ... Read More
148 Views
The java.util.regex.MatcheResult interface provides methods to retrieve the results of a match.You can get an object of this interface using the toMatchResult() method of the Matcher class. This method returns a MatchResult object which represents the match state of the current matcher.The groupCount() method of this interface counts and returns the number of groups in the regular expression of the current object.Example Live Demoimport java.util.Scanner; import java.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; public class GroupCount { public static void main( String args[] ) { String regex = "(.*)(\d+)(.*)"; //Reading input from user ... Read More
518 Views
Greedy quantifiers are the default quantifiers. A greedy quantifier matches as much as possible from the input string (longest match possible) if match not occurred it leaves the last character and matches again. Following is the list of greedy quantifiers −QuantifierDescriptionre*Matches zero or more occurrences.re?Matches zero or, 1 occurrence.re+Matches one or more occurrences.re{n}Matches exactly n occurrences.re{n, }Matches at least n occurrences.re{n, m}Matches at least n and at most m occurrences.ExampleIn the following Java example we are trying to match 1 or more digits, our input string is 45545 though the values 4, 45, 455 etc… are eligible, since we are ... Read More
401 Views
The regular expression "\S" matches a non-whitespace character and the following regular expression matches one or more non space characters between the bold tags."(\S+)"Therefore to match the bold fields in a HTML script you need to −Compile the above regular expression using the compile() method.Retrieve the matcher from the obtained pattern using the matcher() method.Print the matched parts of the input string using the group() method.Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main(String[] args) { String str = "This is an example>/b> HTML script."; //Regular expression to match contents of ... Read More
594 Views
The subexpression/metacharacter “\E” ends the quoting begun with \Q. i.e. you can escape metacharacters in the regular expressions by placing them in between \Q and \E. For example, the expression [aeiou] matches the strings with vowel letters in it.Example Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SampleProgram { public static void main( String args[] ) { String regex = "[aeiou]"; Scanner sc = new Scanner(System.in); System.out.println("Enter input string: "); String input = sc.nextLine(); //Creating a Pattern object Pattern pattern = ... Read More
133 Views
The PatternSyntaxException class represents an unchecked exception thrown in case of a syntax error in regex string. This class contains three main methods namely −getDescription() − Returns the description of the error.getIndex() − Returns the error index.getPattern() − Returns the regular expression pattern with error.getMessage() − Returns the complete message congaing the error, index, regular expression pattern with error, indication of the error in the pattern.Example Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; public class PatternSyntaxExceptionExample { public static void main(String args[]) { //Reading String from user System.out.println("Enter a String"); ... Read More
6K+ Views
In Java, the strings that are used to find the pattern are known as regular expressions. In this article, we will learn to check multiple regex patterns against an input, and it can be done by using 2 approaches. Using Metacharacter Using the List object Using Metacharacter The meta character "|" in Java regular expressions allows you to match more than one regular expression. For example, if you need to match a particular input text with more than one expression, you need to separate them using the following: exp1|exp2|exp3 Example ... Read More
384 Views
Following is the regular expression to match hexadecimal number greater than 10 with even length −^(?=.{10,255}$)(?:0x)?\p{XDigit}{2}(?:\p{XDigit}{2})*$Where,^ − Matches the starting of the sentence.(?=.{10,255}$) − String ending with characters with 10 to 255.\p{XDigit}{2} − Two hexa-decimal characters.(?:\p{XDigit}{2})* − 0 or more sequences of double hexa-decimal characters.$ − Matches the end of the sentence.Example 1 Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class JavaExample51 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String nums[] = new String[5]; for(int i=0; i
451 Views
The java.util.function.UnaryOperator interface and can be used as assignment target for lambda expressions, it represents operation on a single operand whose result will be of same type as the input. We can create our own UnaryOperator by implementing this interface.The replaceAll() method of the List interface accept an object of the UnaryOperator representing a particular operation performs the specified operation on all the elements of the current list and replaces the existing values with the resultant values.In the following example we are implementing the UnaryOperator interface and creating a custom unary operator object and trying to pass it as an ... Read More