Thanks You So Much Durga sir................🙏🙏🙏🙏🙏🙏
@vivektadpatri74138 жыл бұрын
Instead of m.group(0).equals(args[0]) , we can write the regex as "^(0|91)?[789]\\d{9}$"
@MrAnkit812 Жыл бұрын
Sir, Matcher m = p.matcher(args[0]); , I didnn't understand why we put "args[0]" in it. can you please explain once again and another thing is if we pass args[0] then it will take just first part of the number that is --> either 0 or 91 or It will take whole number as input
@DurgaSoftwareSolutions Жыл бұрын
Hello Ankir. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@RoloJE19 жыл бұрын
Great video. One could also return Boolean m.matches(args[0]);
@richcohen59366 жыл бұрын
Doesn't the email's 1st character have to be alphabet only?? 14:15
@DurgaSoftwareSolutions6 жыл бұрын
Hello Rich Cohen. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627,7207212427/28
@MrGayathriram8 жыл бұрын
The easiest way is: if (m.matches()) valid else invalid
@sunnymaurya46336 жыл бұрын
Here is the explanation of both method boolean matches() test whether the regular expression matches the pattern. boolean find() finds the next expression that matches the pattern.
@ekeshkumar62674 жыл бұрын
sir your code is showing error in eclipse
@ekeshkumar62674 жыл бұрын
sir it is showing index 0 out of bound for length 0
@DurgaSoftwareSolutions4 жыл бұрын
Hello Ekesh. Plz contact our online team durgasoftonlinetraining@gmail.com or call us on this number +918885252627, 7207212427/28
@sharon71613 жыл бұрын
import java.util.regex.*; import java.util.*; public class Regex { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Pattern p = Pattern.compile("(0|91)?[7-9][0-9]{9}"); System.out.print("Enter your mobile number: "); String mobile = scan.nextLine(); Matcher m = p.matcher(mobile); if(m.find() && m.group().equals(mobile)) { System.out.println("Valied"); } else { System.out.println("Invalied"); } } }