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

  • Home
  • SEARCH
  • 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 8008805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:15:06+00:00 2026-06-04T18:15:06+00:00

How i can do a simple pattern matching in blackberry OS 6.0. The purpose

  • 0

How i can do a simple pattern matching in blackberry OS 6.0. The purpose is to check whether the user name entered to the UserName edit field contains special characters…. plz help me
thanks jibysthomas

  • 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-06-04T18:15:07+00:00Added an answer on June 4, 2026 at 6:15 pm

    A better solution would be to control the user input by adding an appropriate TextFilter to your edit field. That has the added benefit of modifying the on-screen keyboard to match your filter on those devices so equipped.

    Here is an example combining the action of two built in text filters to make one that only allows upper letters and numbers:

    import net.rim.device.api.ui.text.TextFilter;
    import net.rim.device.api.system.Characters;
    
    /**
    * A TextFilter class to filter for station identifiers
    */
    private static class StationFilter extends TextFilter {
    
     // Order of the supporting filters is important, NUMERIC will convert
     // letters to numbers if it gets them first.
     private static TextFilter[]      _tf = {
      TextFilter.get(TextFilter.NUMERIC),
      TextFilter.get(TextFilter.UPPERCASE)
     };
    
    // Convert using the first supporting filter that has a conversion
     public char convert( char character, int status) {
      char c = 0;
    
      for (int i = _tf.length - 1; i >= 0; i--) {
       c = _tf[i].convert(character, status);
       if (c != 0) {
        return c;
       }
      }
    
      return 0;
     }
    
    // Validate a space for separator, then by supporting filter
     public boolean validate(char character) {
      if (character == Characters.SPACE) {
       return true;
      }
    
      for (int i = _tf.length - 1; i >= 0; i--) {
       boolean b = _tf[i].validate(character);
       if (b) {
        return true;
       }
      }
    
      return false;
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a pattern, Xml structure, architecture technique we can use to create simple
I have two models jobs and clients . A user can simple create a
I am trying to use a simple pattern matching analysis to find all Factory
I need some help with a simple pattern matching and replacement exercise I am
Can anyone share sample of using Builder pattern to confirm OCP (Open-Closed Principle). Which
This should be simple - can't figure out where I'm going wrong: We have
if so can show simple example, ex in jquery ajax.post
Where i can find simple tutorial for Activiti Alfresco Workflow (especially with Custom Workflow)
my question is pretty simple: can PHP and Java communicate, while PHP being the
I new with jquery and I can do simple coding with it. and I

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.