سؤال

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'

هل كانت مفيدة؟

المحلول 2

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

نصائح أخرى

Pattern is pretty simple:

/(root)/

You can add some modifiers i, g, m:

/(root)/i // for case-insensitive search
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top