Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6847921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:48:14+00:00 2026-05-27T00:48:14+00:00

I am trying to create a regex for the following UA string: Mozilla/5.0 (BlackBerry;

  • 0

I am trying to create a regex for the following UA string:

Mozilla/5.0 (BlackBerry; U; BlackBerry 9850; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.115 Mobile Safari/534.11+

I want to know if the device is a Blackberry 5.0 so I can create a non ajax jquery mobile site.

I can get the Mozilla/5.0 bit ok but im really struggling to match the word Blackberry.

Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:48:14+00:00Added an answer on May 27, 2026 at 12:48 am

    According to this administrator’s Blackberry Support Community Forums Post, AJAX support for BlackBerry phones was released with version 4.6

    According to this list, BlackBerry UA Strings have always contained the word BlackBerry, have usually contained the phone model number, and have always contained a version number:

    Mozilla/5.0 (BlackBerry; U; BlackBerry 9860; en-GB) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.296 Mobile Safari/534.11+
    Mozilla/5.0 (BlackBerry; U; BlackBerry 9300; fr) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.570 Mobile Safari/534.8+
    Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.600 Mobile Safari/534.8+
    Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-US) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+
    Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+
    Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-US) AppleWebKit/530.17 (KHTML, like Gecko) Version/6.0.0.62 Mobile Safari/530.17
    BlackBerry9650/5.0.0.732 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/105
    BlackBerry9700/5.0.0.351 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/123
    BlackBerry9630/4.7.1.40 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
    BlackBerry9000/4.6.0.167 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
    BlackBerry8330/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
    BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
    BlackBerry8820/4.2.2 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/102
    BlackBerry8703e/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105
    BlackBerry8320/4.5.0.188 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
    BlackBerry8330/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/106
    BlackBerry8320/4.3.1 Profile/MIDP-2.0 Configuration/CLDC-1.1
    BlackBerry8110/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/118
    BlackBerry8130/4.5.0.89 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/106
    BlackBerry7100i/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/103
    BlackBerry7130e/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/104
    BlackBerry7250/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1
    BlackBerry/3.6.0
    BlackBerry7230/3.7.0
    BlackBerry7230/3.7.1
    BlackBerry7730/3.7.0
    BlackBerry7730/3.7.1 UP.Link/5.1.2.5
    

    the version number comes either after the word BlackBerry, possibly a model number consisting of numbers and letters, then a forward slash (/), or it comes well after the word BlackBerry, but immediately following the string Version/

    Using this expression:

    BlackBerry(\w*/|.*?Version/)(((?:[0-3]|4\.[0-5])\.[.\d+]+)|((?:4\.[6-9]|1?[5-9])[.\d+]+)|([\w.]+))?
    

    In a find-type regular expression parser (like PHP’s preg_match(), .Net’s Regex.Match(), or Java’s matcher.find() functions) this expression will allow discerning between a version number from 0.0.X to 4.5.X and a version number from 4.6.X to X.X.X where X represents any number not previously matched.

    What’s that now? Sorry… in other words, using that regex against a user agent string should allow you to determine whether it’s a BlackBerry browser or not AND whether the version number indicates support for AJAX (pseudo-code):

    regex = "BlackBerry(\w*/|.*?Version/)(((?:[0-3]|4\.[0-5])\.[.\d+]+)|((?:4\.[6-9]|1?[5-9])[.\d+]+)|([\w.]+))?";
    result = regex.find(UserAgentString);
    if (result.matchFound)
    {
        actualVersion = result.matchGroup(2);
        if (result.matchGroup(3) != "")
        {
            print("Version " + actualVersion + " does not support AJAX");
        }
        else if (result.matchGroup(4) != "")
        {
            print("Version " + actualVersion + " supports AJAX!");
        }
        else if (result.matchGroup(5) != "")
        {
            print("Unknown whether Version " + actualVersion + " supports AJAX!?!?");
        }
    }
    print("Not A BlackBerry Browser");
    

    Summary: Match group #1 (could be made optional) matches the part between BlackBerry and any matched version number. Group #2 matches the version number. Group #3 contains the version number if it is 0.0.X to 4.5.X. Group #4 contains the version number if it is 4.6.X or greater, if it only consists of digits and decimal points. If the version does not seem to match this convention, possibly if there are letters or underscores as well, then it will be captured into Group #5.

    I think this is all you need (once translated into whichever language you are using). The expression should be supported by .Net, Java, PHP, or even JavaScript if necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a regex to tokenize a string. An example of the
I'm trying to create a regex expression to match any string that has exactly
I'm trying to create a regex pattern to match the lines in the following
I'm trying to create a <asp:regularexpressionvalidator> with following conditions: String must be have 8
I am trying to create a RegEx expression that will successfully parse the following
I'm trying to create a regex that will match the following: http://myurl.com/en/something I need
I'm trying to create a regex that will accept the following values: (blank) 0
I am trying to create a regular expression for the following rule. RegEx: ([A-Z]|[0-9])[\\.a-zA-Z0-9_-]{0,}$
I've been trying to create a RegEx for a string for almost a day
I am trying to create a regex in C# to extract the artist, track

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.