Regular Expressions 101

Community Patterns

Get Sku, leave out _# before file extension (version 2)


Regular Expression
PCRE2 (PHP >=7.3)



Another rendition of the previous expression, without the lazy quantification. Here, the expression will match any character except for the underscore character, so if there is an underscore, it will stop and evaluate the lookahead.

I wonder which one is faster

Submitted by anonymous - 2 years ago