Consider the following statement :
if(UserAgent.matches("iPhone"))
I have to detect whether the user is online from a mobile or a PC. To do this I need to check for large number mobile devices,browsers. Instead of writing the same part :
if(UserAgent.matches())
Is there any way I can check this using on matches function ? I meant to say by using | which is OR. Like :
UserAgent.matches(SOME MODIFICATION "iPhone" | "Android" | "Blackberry".....)
Actually, String.matches() is matching as a Regular Expression, so you may write something like