Reputation: 3
I'm very new to this regular expression bit.
I've been trying these online services but at loss.
I need it explained to me how to write a pattern that match deroot, derooted, rooted and root anywhere in string when searching for 'root'
Upvotes: 0
Views: 214
Reputation: 1132
Pattern is pretty simple:
/(root)/
You can add some modifiers i, g, m:
/(root)/i // for case-insensitive search
Upvotes: 1
Reputation: 11116
preg_match("/root/s", $input_line, $output_array);
you can use this to find any string that contains root
.
demo here : http://www.phpliveregex.com/p/4v0
Upvotes: 0