Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?P<Hex>(?<=.[^}{])#(?:[\dA-F]{6}|[\dA-F]{3})(?=\W[^}{]))+
"
ig

Description

A solution of this test from HackerRank

https://www.hackerrank.com/challenges/hex-color-code/problem

Submitted by anonymous - 3 years ago