Regular Expressions 101

Community Patterns

Find If a user agent is likely to be a phone or tablet

1

Regular Expression
PCRE (PHP <7.3)

/
android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos
/
igm

Description

This regular expression will find key word in a user agent and to easily flag them has a phone or tablet.

Submitted by anonymous - 4 years ago