Regular Expressions 101

S⁠ponsors

Community Library

Community Library Entry

2

Regular ExpressionOpen Workspace

/
^(?:(?:1?\d?\d|2[0-4]\d|25[0-5])\.?\b){4}$
/
mg

Description
Created·2025-01-23 05:35
Type·Match
Flavor·PCRE2 (PHP)

Near-optimal solution for Task 7 https://regex101.com/quiz/7 . Optimal is 39 characters.

Credit to Danail Gabenski on stackoverflow for the \.\b trick.

Submitted by chakra
Open Workspace