-
Practice>Python>Regex and Parsing>Hex Color Codehackerrank.com 2019. 4. 12. 13:16728x90
Hex Color Code
Problem Link : https://www.hackerrank.com/challenges/hex-color-code/problem
Difficulty : Easy
Tip
- We should use lookahead in regular expression
- #{1}[0-9A-Fa-f]{3,6}
- This regular expression have a problem, because it capture from the beginning of the sentence
- So, we should put lookahead, to exclude if # is started from the beginning of the sentence
- (?<=.)#{1}[0-9A-Fa-f]{3,6}
Solution
728x90'hackerrank.com' 카테고리의 다른 글
Practice>Python>Regex and Parsing>HTML Parser - Part 2 (0) 2019.04.15 Practice>Python>Regex and Parsing>HTML Parser - Part 1 (0) 2019.04.15 Practice>Python>Regex and Parsing>Validating and Parsing Email Addresses (0) 2019.04.12 Practice>Python>Regex and Parsing>Validating phone numbers (0) 2019.04.11 Practice>Python>Regex and Parsing>Validating Roman Numerals (0) 2019.04.11