[Mobile Utilities] [Mobile Utilities] Regex_Search not working

[Mobile Utilities] [Mobile Utilities] Regex_Search not working

  
Forge Component
(11)
Published on 2017-09-05 by Miguel Vicente
11 votes
Published on 2017-09-05 by Miguel Vicente

Hello,

I'm trying to use Regex_Search on my mobile application with the following pattern:

SyntaxEditor Code Snippet

"(?=.*[a-z])(?=.*[A-Z])(?=.*\d)"

Everytime the 'isFound' output returns false. I'm using the same pattern in the web Regex_Search action and it's working fine.

Cheers,

Rafael Battistelo wrote:

Hello,

I'm trying to use Regex_Search on my mobile application with the following pattern:

SyntaxEditor Code Snippet

"(?=.*[a-z])(?=.*[A-Z])(?=.*\d)"

Everytime the 'isFound' output returns false. I'm using the same pattern in the web Regex_Search action and it's working fine.

Cheers,

Hi Rafael,

Try the below regex:

"(?=.*[a-z]).(?=.*[A-Z]).(?=.*\d)."

I suppose you were not supplying the dot at the end of each match pattern.


Jitul Joy wrote:

Rafael Battistelo wrote:

Hello,

I'm trying to use Regex_Search on my mobile application with the following pattern:

SyntaxEditor Code Snippet

"(?=.*[a-z])(?=.*[A-Z])(?=.*\d)"

Everytime the 'isFound' output returns false. I'm using the same pattern in the web Regex_Search action and it's working fine.

Cheers,

Hi Rafael,

Try the below regex:

"(?=.*[a-z]).(?=.*[A-Z]).(?=.*\d)."

I suppose you were not supplying the dot at the end of each match pattern.


Hi Jitul,

Still not working on mobile regex.


Hi Rafael,

Can you tell me of some some sample matches that are working in the web regex?

In the meanwhile try with a capturing group, by adding () into your regex, like this:

((?=.*[a-z]).(?=.*[A-Z]).(?=.*\d).)

For regular expressions, you can try using the Text and HTML Processing component as well:

https://www.outsystems.com/forge/component/2007/text-and-html-processing/

It includes more features than the system Text extension, for example captured groups. 

Jitul Joy wrote:

Hi Rafael,

Can you tell me of some some sample matches that are working in the web regex?

In the meanwhile try with a capturing group, by adding () into your regex, like this:

((?=.*[a-z]).(?=.*[A-Z]).(?=.*\d).)

For regular expressions, you can try using the Text and HTML Processing component as well:

https://www.outsystems.com/forge/component/2007/text-and-html-processing/

It includes more features than the system Text extension, for example captured groups. 

Hi Jitul,

That's the point, i'm using the Regex_Search action from Text component in my web application with "(?=.*[a-z])(?=.*[A-Z])(?=.*\d)" pattern and it's working fine.

The problem is that i need to use the Regex_Search in my mobile application while in offline mode. For that i'm using the Regex_Search action from the MobileUtilities component, and it always returns that no matches are found.

Hi Rafael,

I hope it finds you well.

To provide you with some help I will need a sample of a text that you are trying to search with this pattern to then help you with some possible solution.

Thank you,

Kind Regards

Miguel Vicente


Miguel Vicente wrote:

Hi Rafael,

I hope it finds you well.

To provide you with some help I will need a sample of a text that you are trying to search with this pattern to then help you with some possible solution.

Thank you,

Kind Regards

Miguel Vicente


Hi Miguel,

In this case i need to validate if the text has at least one uppercase letter, one lowercase letter and one number. 

Examples: 

Abc2018 - returns isFound = true;

abc2018 - returns isFound = false;

ABC2018 - returns isFound = false;

Abc - returns isFound = false;

In case you need any other information, let me know.

Thanks.



Hi again,

For your use case instead of using Regex_Search try to use Regex_Test just to check if it works. If not let me know. 

Kind Regards,

Miguel Vicente