i want to ask, what is the meaning or difference between these two line?
-
if( preg_match_all('/\#([א-תÀ-ÿ一-龥а-яa-z0-9\-_]{1,50})/iu', $message, $matches, PREG_PATTERN_ORDER) ){ -
if( preg_match_all('/\#([а-яa-z0-9\-_\x{4e00}-\x{9fa5}]{1,50})/iu', $message, $matches, PREG_PATTERN_ORDER) ) {
and what does the number 3 mean in this line? (Arrow pointing)
if( preg_match_all('/\@([a-zA-Z0-9\-_\x{4e00}-\x{9fa5}]{->3,30})/u', $message, $matches, PREG_PATTERN_ORDER) ) {
Thanks!
I’ll answer the 2nd part of your question:
The
{3,30}in the regex meansquantifierfor aminof3and a max of30repetitions.a*means zero or moreaa+means one or moreaa?means zero or oneaa{1}means exactly one a same asjust
aa{1,}means one or more a same asa+a{1,3}means min of one and max of3
a'syou can have any complex regex in place of
a. Example:[a-zA-Z]{3,30}would mean at least3and at max30of any of the alphabets.