Maruthi Krishna has Published 870 Articles

Moving all Upper case letters to the end of the String using Java RegEx

Maruthi Krishna

Maruthi Krishna

Updated on 21-Nov-2019 07:29:15

775 Views

The subexpression “[ ]” matches all the characters specified in the braces. Therefore, to move all the upper case letters to the end of a string −Iterate through all the characters in the given string.Match all the upper case letters in the given string using the regular expression "[A-Z]".Concatenate the ... Read More

Moving all special char to the end of the String using Java Regular Expression RegEx)

Maruthi Krishna

Maruthi Krishna

Updated on 21-Nov-2019 07:26:50

2K+ Views

The following regular expression matches all the special characters i.e. all characters except English alphabet spaces and digits."[^a-zA-Z0-9\s+]"To move all the special characters to the end of the given line, match all the special characters using this regex concatenate them to an empty string and concatenate remaining characters to another ... Read More

How to match a particular word in a string using Pattern class in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 21-Nov-2019 07:24:54

1K+ Views

The \b meta character in Java regular expressions matches the word boundaries Therefore to find a particular word from the given input text specify the required word within the word boundaries in the regular expressions as −"\brequired word\b";Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class MachingWordExample1 {    public ... Read More

Matcher usePattern() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 21-Nov-2019 07:22:43

123 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The usePattern() method of the Matcher class accepts a Pattern object representing a new regex pattern and ... Read More

Matcher quoteReplacement(String s) method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:43:12

543 Views

The appendReplacement() method of the Matcher class accepts a StringBuffer object and a String (replacement string) as parameters and, appends the input data to the StringBuffer object, replacing the matched content with the replacement string.Internally, this method reads each character from the input string and appends the String buffer, whenever ... Read More

Matcher hitEnd() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:38:51

115 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The hitEnd() method verifies whether the end of the input data reached during the previous match if ... Read More

Matcher useAnchoringBounds() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:32:57

159 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The anchoring bounds are used to match the region matches such as ^ and $. By default, ... Read More

Matcher hasTransparentBounds() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:29:16

102 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.In regular expressions, the lookbehind and lookahead constructs are used to match a particular pattern that is ... Read More

Matcher hasAnchoringBounds() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:24:47

119 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The anchoring bounds are used to match the region matches such as ^ and $. By default ... Read More

Matcher lookingAt() method in Java with Examples

Maruthi Krishna

Maruthi Krishna

Updated on 20-Nov-2019 07:20:14

142 Views

The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The lookingAt() method of the Matcher class matches the given input text with the pattern, starting from ... Read More

Advertisements