我想找到所有使用 PHP 和 regEx 的演示词。
$input ='demo';
$pattern = ''; //$input can be used along with regex, please help here
$text = 'This is dem*#o text, contains de12mo3 text, is .demo23* text'
if(preg_match($pattern, $text))
{
echo 'found';
}else{
echo'not found';
}
demo
中的搜索词text
可能以下列格式出现
1) may start with special characters/numbers Eg. "12*demo"
2) may contain special characters/numbers within the word Eg. "de12*mo"
3) may end with special characters/numbers Eg. "demo12*"
请帮助我卡住了,在此先感谢!
笔记:The $input can be max. of 15 in length