Being plagued with annoying spam over the last few weeks on my forums and looking to build a quick function to detect strings that look like this:
Watch () Online
Stream () Online
So if the post string = $post_text - are there any code examples as to how I could use preg_match_all to detect it - if $post_text contains at least one instance of the above, then do this.
The square bracket group means any character within the bracket selection so you are basically eliminating any words containing those letters and a comma!
This should work better and preg_match (without all) should be suffictient:
buy watch online now!
watch online
Watches online
WATCH-ONLINE
WATCH any text here provided it’s in one line(!) ONLINE
Stream online
best streaming online
If you want to also catch cases when the two words are in different lines then add the ‘s’ modifier to the end of the regex.