Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 166
Registered: ‎01-14-2009
My Device: Curve 8330

PatternRepository return part of match

Hello,

I have an application which does pattern matching on specific email address. Everything work fine in OS4.3 but in OS5.0 my method receive part of the match (just ".com" or "samuel.dionne" ...). Here is a code snippet:

 

 

// On device startup
ApplicationDescriptor descriptor = ApplicationDescriptor.currentApplicationDescriptor();
descriptor.getArgs()[0] = "";
PatternRepository.addPattern(descriptor,  "^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@company\\.com$", PatternRepository.PATTERN_TYPE_REGULAR_EXPRESSION, menuArray);


// In the ApplicationMenuItem
public Object run(Object context) {
    String email = "";

    if (context instanceof String) {
        email = (String) context;
        Application.getApplication().requestForeground();
        
        [...]
    }
}

 

Trying with Curve 8330 OS4.5 working fine but not with 9700 OS5.0

 

Thank you, have a nice day.

--
Samuel D.
Highlighted
Visitor
Posts: 1
Registered: ‎06-04-2010
My Device: 8900
My Carrier: T-Mobile DE

Re: PatternRepository return part of match

[ Edited ]

Same Problem here. I try to match sth. like "AB 123" and only receive "AB", even if I point the cursor to the "123" part. Any ideas?

 

(Edit: 9700 Simulator with 5.0)