<?php
$regex = '/\d/i';
$result = preg_match($regex , "PHP is 2the w3eb scr4ipti5ng language of choice." );
$subject = "dd133aa2";
$pattern = '/\d+/';
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE
);
$subject = "dd133aa2";
$pattern = '/\d+/';
$subject = array("dd133aa2", "kk1ff3"); $pattern = '/\d+/';
$subject = "dd133aa2";
$pattern = '/\d+/';
//$matches [0] => 133
//$matches [0] => 2
return 'Z';
}, $subject);
//print_r($result);
$subject = array("dd133aa2", "kk1ff3", "ddsdfd"); $pattern = '/\d+/';
$result2 = preg_grep($pattern, $subject, PREG_GREP_INVERT
);
$subject = "dd133aa2cc";
$pattern = '/(\d+)/';
$result2 = preg_split($pattern, $subject, null, PREG_SPLIT_DELIM_CAPTURE
);
preg_match('/(?:\D+|<\d+>)*[!?]/', 'foobar foobar foobar'); //print_r($result);
$subject = "dd.a?a2cc";
//print_r($result2);
PD9waHAKCiRyZWdleCA9ICcvXGQvaSc7CiRyZXN1bHQgPSBwcmVnX21hdGNoKCRyZWdleCAsICAiUEhQIGlzIDJ0aGUgdzNlYiBzY3I0aXB0aTVuZyBsYW5ndWFnZSBvZiBjaG9pY2UuIiApOwoKJHN1YmplY3QgPSAiZGQxMzNhYTIiOwokcGF0dGVybiA9ICcvXGQrLyc7CnByZWdfbWF0Y2goJHBhdHRlcm4sICRzdWJqZWN0LCAkbWF0Y2hlcywgUFJFR19PRkZTRVRfQ0FQVFVSRSk7CnByaW50X3IoJG1hdGNoZXMpOwoKJHN1YmplY3QgPSAiZGQxMzNhYTIiOwokcGF0dGVybiA9ICcvXGQrLyc7CnByZWdfbWF0Y2hfYWxsKCRwYXR0ZXJuLCAkc3ViamVjdCwgJG1hdGNoZXMsIFBSRUdfT0ZGU0VUX0NBUFRVUkUpOwpwcmludF9yKCRtYXRjaGVzKTsKCiRzdWJqZWN0ID0gYXJyYXkoImRkMTMzYWEyIiwgImtrMWZmMyIpOwokcGF0dGVybiA9ICcvXGQrLyc7CiRyZ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