What does (?: do in a regular expression

(?:) creates a non-capturing group. It groups things together without creating a backreference.

A backreference is a part you can refer to in the expression or a possible replacement (by saying \1 or $1 etc – depending on flavor). You can also extract them from a match afterwards when using regex in a programming language. The main reason for using (?:) is to avoid creating a new backreference, which avoids incrementing the group number which is especially important if you’re repeating a group and do not want to have unpredictable group numbers, and saves (a usually negligible amount of) memory

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)