Forum

HomeHomeCoreCoreGeneralGeneralUsing RegexUsing Regex
Previous
 
Next
New Post
1/24/2019 3:19 AM
 

Hi All,

Anyone know how to use Regex ?

Basically I want to check the user agent to see if it is a bot or crawler

I found this piece of code in PHP


if (preg_match('/baidu|bingbot|facebookexternalhit|googlebot|-google|ia_archiver|msnbot|naverbot|pingdom|seznambot|slurp|teoma|twitter|yandex|yeti|linkedinbot|pinterest/i', $this->get_user_agent())) {


So using OWS how can I use regex to check [Request.UserAgent,System] against '/baidu|bingbot|facebookexternalhit|googlebot|-google|ia_archiver|msnbot|naverbot|pingdom|seznambot|slurp|teoma|twitter|yandex|yeti|linkedinbot|pinterest/i'


Many thanks in advance for any help given

Tony

Previous
 
Next
HomeHomeCoreCoreGeneralGeneralUsing RegexUsing Regex


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share