preg_match
の返り値で判断。
function is_regexp_string($pattern) {
return @preg_match($pattern, '') !== false;
}
Go to list of users who liked
More than 5 years have passed since last update.
preg_match
の返り値で判断。
function is_regexp_string($pattern) {
return @preg_match($pattern, '') !== false;
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked