Question: I want to find all the demo words using PHP and 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';
}

```

the search word `demo` in the `text` may be present in the following format

```
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*"

```

please help I am stuck,
thanks in advance!

Note: `The $input can be max. of 15 in length`

Answer: 
```
/\b[^a-z]*d[^a-z]*e[^a-z]*m[^a-z]*o[^a-z]*\b/i

```

Matches anything but a-z between the demo characters
Probably not efficient; But you could use this:

`/(.*)d(.*)e(.*)m(.*)o(.*)/i`

That would match anything.