Matching Specific Characters

Sort by

recency

|

81 Discussions

|

  • + 0 comments
    Regex_Pattern = r'^[1-3][0-2][xs0][0-3Aa][xsu][.,]$'
    
  • + 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("^[123][120][xs0][30Aa][xsu][.,]$");
            Matcher matcher = pattern.matcher(scanner.nextLine());
            System.out.println(matcher.find());
        }
    }
    
  • + 0 comments

    Regex pattern = "^[123][120][xs0][30Aa][xsu][.,]$"

  • + 0 comments

    java solution

    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("[1-3][0-2][xs0][30Aa][xsu][\\.,]");
            Matcher matcher = pattern.matcher(scanner.next());
            System.out.println(matcher.matches());
        }
    }
    
  • + 0 comments

    Regex_Pattern = r'^[123][012][xS0][30Aa][xsu][.,]$' # Do not delete 'r'.

    import re

    print(str(bool(re.search(Regex_Pattern, raw_input()))).lower()) its not passing this test case 21sAu,