Michael M
Michael M

Reputation: 1

Need a simple regex

Hi I need a Simple Regular expression in PCRE format to match something like

(Child OR Children) AND toys

Upvotes: 0

Views: 599

Answers (2)

anubhava
anubhava

Reputation: 784958

Question is not very clear about how word toys will appear after OR condition, but I think following should work for you:

/(?:^|\b)child(?:ren|)\b.*?(?<=\btoys\b)/i

Upvotes: 1

user142162
user142162

Reputation:

The following, or a slight derivative of the following, should work for you:

/(?:child|children) toys/i

Upvotes: 3

Related Questions