I need some help with a regular expression. I am trying to match user agent strings for mobile css. Right now, I am having trouble matching mobile but not iPad. In other words if I had two user agent strings that looked something like,
random stuff ipad random text in between mobile
and
random stuff iphone random text in between mobile
The way I have it setup is something like,
if (!preg_match("/(?!ipad).*mobile|iphone|blackberry/",$user_agent)
{ // show desktop version
}
else { //show mobile version
}
however I am not even sure if that is right, and I am not getting the desired result I want. Again the end goal being to show the desktop version on ipad.