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 6004603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:17:10+00:00 2026-05-23T01:17:10+00:00

I hope this title makes sense – I need case-insensitive regex matching on BlackBerry

  • 0

I hope this title makes sense – I need case-insensitive regex matching on BlackBerry 5.

I have a regular expression defined as:

    public static final String SMS_REG_EXP = "(?i)[(htp:/w\\.)]*cobiinteractive\\.com/[\\w|\\%]+";

It is intended to match “cobiinteractive.com/” followed by some text. The preceding (htp:w.) is just there because on my device I needed to override the internal link-recognition that the phone applies (shameless hack).

The app loads at start-up. The idea is that I want to pick up links to my site from sms & email, and process them with my app.

I add it to the PatternRepository using:

    PatternRepository.addPattern(
        ApplicationDescriptor.currentApplicationDescriptor(),
        GlobalConstants.SMS_REG_EXP,
        PatternRepository.PATTERN_TYPE_REGULAR_EXPRESSION,
        applicationMenu);
  • On the os 4.5 / 4.7 simulators and on
    a Curve 8900 device (running 4.5),
    this works.
  • On the os 5 simulators and the Bold
    9700 I tested, app fails to compile
    the pattern with an
    IllegalArgumentException(“unrecognized
    character after (?”)
    .

I have also tried (naively) to set the pattern to “/rockstar/i” but that only matches the exact string – this is possibly the correct direction to take, but if so, I don’t know how to implement it on the BB.


How would I modify my regex in order to pick up case insensitive patterns using the PatternRepository as above?

PS: would the “correct” way be to use the [Cc][Oo][Bb][Ii]2… etc pattern? This is ok for a short string, but I am hoping for a more general solution if possible?

  • 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-23T01:17:11+00:00Added an answer on May 23, 2026 at 1:17 am

    Since nobody else has answered this question relating to the PatternRepository class, I will self-answer so I can close it.

    One way to do this would be to use a pattern like: [Cc][Oo][Bb][Ii]2[Nn][Tt][Ee][Rr][Aa][Cc][Tt][Ii][Vv][Ee]… etc where for each letter in the string, you put 2 options. Fortunately my string is short.

    This is not an elegant solution, but it works. Unfortunately I don’t know of a way to modify the string passed to PatternRepository and I think the crash when using the (?i) modifier is a bug in BB.

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

Sidebar

Related Questions

I hope that title makes some sense. I have UIView (created in IB) where
ok, I hope the title of this question makes sense. In my app I
I hope the title of this question makes sense. What I want to know
I hope my title makes sense. I have an iPhone app uses the standard
Ok my first post and i hope the title makes sense. I have an
Hope this makes sense... Is there a simple way to return a set of
I hope this question isn't too dumb. We have many websites internally that need
I'm not sure if the title makes sense, but I hope you can understand
(I hope this is a valid question) As I stated in my title, I'm
no title that fits this bug but this how it goes, i have form

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.