HackerRank-Python(90)
-
Prepare > Regex > Character Class > Matching Character Ranges
Matching Character Ranges | HackerRank Write a RegEx matching a range of characters. www.hackerrank.com 문제 Task Write a RegEx that will match a string satisfying the following conditions: The string's length is >= 5. The first character must be a lowercase English alphabetic character. The second character must be a positive digit. Note that we consider zero to be neither positive nor negative. ..
2023.10.27 -
Prepare > Regex > Character Class > Excluding Specific Characters
Excluding Specific Characters | HackerRank Use the [^] character class to exclude specific characters. www.hackerrank.com 문제 Task You have a test string S. Your task is to write a regex that will match with the following conditions: S must be of length 6. First character should not be a digit (1,2,3,4,5,6,7,8,9 or 0). Second character should not be a lowercase vowel (a,i,e,u or o). Third charact..
2023.10.26 -
Prepare > Regex > Character Class > Matching Specific Characters
Matching Specific Characters | HackerRank Use the [ ] expression to match specific characters. www.hackerrank.com 문제 Task You have a test string S. Your task is to write a regex that will match S with following conditions: S must be of length: 6 First character: 1, 2 or 3 Second character: 1, 2 or 0 Third character: x, s or 0 Fourth character: 3, 0 , A or a Fifth character: x, s or u Sixth chara..
2023.10.25 -
Prepare > Regex > Introduction > Matching Start & End
Matching Start & End | HackerRank Use the ^ symbol to match the start of a string, and the $ symbol to match the end characters. www.hackerrank.com 문제 Task You have a test string S. Your task is to match the pattern Xxxxx. Here, x denotes a word character, and X denotes a digit. S must start with a digit X and end with . symbol. S should be 6 characters long only. 코드 Regex_Pattern = r"^\d\w{4}\...
2023.10.10 -
Prepare > Regex > Introduction > Matching Word & Non-Word Character
Matching Word & Non-Word Character | HackerRank Use \w to match any word and \W to match any non-word character. www.hackerrank.com 문제 Task You have a test string S. Your task is to match the pattern xxxXxxxxxxxxxxXxxx Here x denotes any word character and X denotes any non-word character. => xxxXxxxxxxxxxxXxxx구조를 S에서 찾아라. x는 알파벳과숫자, 언더바(_)이고 X는 그 외 모든 문자. 코드 Regex_Pattern = r"\w{3}\W\w{10}\W\w{..
2023.10.10 -
Prepare > Regex > Introduction > Matching Whitespace & Non-Whitespace Character
Matching Whitespace & Non-Whitespace Character | HackerRank Use \s to match whitespace and \S to match non whitespace characters in this challenge. www.hackerrank.com 문제 Task You have a test string S. Your task is to match the pattern XXxXXxXX Here, x denotes whitespace characters, and X denotes non-white space characters. Note This is a regex only challenge. You are not required to write code. ..
2023.10.09 -
Prepare > Regex > Introduction > Matching Digits & Non-Digit Characters
Matching Digits & Non-Digit Characters | HackerRank Use the expression \d to match digits and \D to match non-digit characters. www.hackerrank.com 문제 => "숫자 숫자 비숫자 숫자 숫자 비숫자 숫자 숫자" 패턴을 찾아라 코드 Regex_Pattern = r"\d{2}\D\d{2}\D\d{4}"# Do not delete 'r'. import re print(str(bool(re.search(Regex_Pattern, input()))).lower()) 노트 왜 안됨? Regex_Pattern = r"[\d{2}\D]{2}\d{4}"# Do not delete 'r'. import re p..
2023.10.07