Matching Digits & Non-Digit Characters

Sort by

recency

|

167 Discussions

|

  • + 0 comments

    I literally don't understand what this question is asking? Anyone else think that the wording/description of this problem is atrociously crap?

  • + 0 comments
    Regex_Pattern = r"\d{2}\D\d{2}\D\d{4}"
    
    import re
    
    print(str(bool(re.search(Regex_Pattern, input()))).lower())
    
  • + 0 comments

    Regex_Pattern = r"^\d\d\D\d\d\D\d\d\d\d"

  • + 0 comments

    82lotteryhack

  • + 0 comments

    Java 15

    import java.io.*;
    import java.util.*;
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    
    public class Solution {
    
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            // Pattern pattern = Pattern.compile("\\d\\d\\D\\d\\d\\D\\d\\d\\d\\d");     \\WORKS
            Pattern pattern = Pattern.compile("(\\d{2}\\D){2}\\d{4}");
            Matcher matcher = pattern.matcher(scanner.next());
            boolean found = matcher.find();
            System.out.println(found);
        }
    }