Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^\/prifix\/([a-zA-Z0-9_\-\!\.\/]+)\/{0,1}((\/(full|square|([1-9]\d*|0),([1-9]\d*|0),([1-9]\d*),([1-9]\d*)|pct:(([1-9]\d*|0)(\.\d+)?),(([1-9]\d*|0)(\.\d+)?),([1-9]\d{0,1}(\.\d*)?|0\.[0]*[1-9]+|100(\.0+)?),([1-9]\d{0,1}(\.\d*)?|0\.[0]*[1-9]+|100(\.0+)?)|(\w+))\/(full|max|([1-9]\d*),|,([1-9]\d*)|(\!)?([1-9]\d*),([1-9]\d*)|pct:(([1-9]\d*)(\.\d+)?)|(\w+))\/(\!)?([1-9]\d*|0|(\w+))(\.\d+)?\/(default|color|gray|bitonal|(\w+))\.(jpg|tif|png|webp|pdf|jp2|(\w+)))|info\.json){0,1}$
/
miUg

Description

Regex for parse IIIF image request url. Support IIIF image api 2.0 and 2.1.

Submitted by anonymous - 5 years ago