Program to check Strength of Password in C++

Sunidhi Bansal
Updated on 20-Nov-2019 10:14:56

6K+ Views

Given a string input containing password characters, the task is to check the strength of the password.The strength of the password is when you tell that the password is whether easily guessed or cracked. The strength should vary from weak, average and strong. To check the strength we have to check the following points −Password must be at least 8 characters long.It must contain 1 lower case alphabet.It must contain 1 uppercase alphabetIt must contain a digitIt must contain a special character like : !@#$%^&*()>= 8))          Print "Strong"       else if ((hasLower || hasUpper) ... Read More

Program to Convert Hexadecimal to Octal in C program

Sunidhi Bansal
Updated on 20-Nov-2019 10:05:51

1K+ Views

We are given a Hexadecimal number as string; the task is to convert it to the Octal. To convert a hexadecimal number to octal, we have to −Find the binary equivalent to the hexadecimal number.Convert the binary number to Octal.What are hexadecimal numbersHexadecimal numbers are the numbers which are of base of 16 the numbers vary from 0-9 and from 10 onwards the numbers are represented as A which represents 10, B for 11, C for 12, D for 13, E for 14, and F for 15.To convert hexadecimal number into binary number every number is converted into its binary ... Read More

Matcher quoteReplacement(String s) method in Java with Examples

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

222 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 a match occurs it appends the replacement string instead of matched content part of the string to the buffer and, proceeds from the next position of the matched substring.While passing the replacement string to this method if you use “/” or “$” they will not be considered as regular characters ... Read More

Matcher hitEnd() method in Java with Examples

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

55 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 so, it returns true else false. If this method returns true it indicates that more input data might change the result of the match.For example, if you are trying to match the last word of an input string to you using the regex “you$” and if your 1st input line ... Read More

Matcher useAnchoringBounds() method in Java with Examples

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

63 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, a matcher uses anchoring bounds.The useAnchoringBounds() method of this class method accepts a boolean value and, if you pass true to this method the current matcher uses anchoring bounds and if you pass false to this method it uses non-anchoring bounds.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Trail ... Read More

Matcher hasTransparentBounds() method in Java with Examples

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

33 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 preceding or, succeeding in some other pattern. For example, if you need to accept a string which accepts 5 to 12 characters the regular expression will be −"\A(?=\w{6, 10}\z)";By default, the boundaries of the matcher region are not transparent to the constructs lookahead, lookbehind and, boundary matching i.e. These constructs ... Read More

Matcher hasAnchoringBounds() method in Java with Examples

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

38 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 a matcher uses anchoring bounds, you can switch from using anchoring bounds to non-anchoring bounds using the useAnchoringBounds() method.The hasAnchoringBounds() method of this (Matcher) class verifies whether the current matcher uses anchoring bounds if so, it returns true else, it returns false.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class HasAnchoringBoundsExample { ... Read More

Matcher lookingAt() method in Java with Examples

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

41 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 the beginning of the region. In case of a match, this method returns true, else, false. Unlike the matches() method this method doesn’t require a match in the entire region to return true.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test {    public static void main(String[] args) {     ... Read More

Matcher toMatchResult() method in Java with Examples

Maruthi Krishna
Updated on 20-Nov-2019 07:17:12

176 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 toMatchResult() method of this (Matcher) returns the match state of the current matcher.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class ToMatchResultExample {    public static void main(String[] args) {       String str = "This is an example.";       //Regular expression to match contents of the bold tags       String regex = "(\S+)";       //Creating a pattern object     ... Read More

Matcher regionEnd() method in Java with Examples

Maruthi Krishna
Updated on 20-Nov-2019 07:10:54

87 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 regionEnd() method of this (Matcher) class returns an integer value representing the end index of the current matcher object.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegionEndExample {    public static void main(String[] args) {       String regex = "(.*)(\d+)(.*)";       String input = "This is a sample Text, 1234, with numbers in between.";       //Creating a pattern object     ... Read More

Advertisements