Highlighted
Contributor.
Contributor.
671 views

Correlate with regexp help

Jump to solution

Hi all!

I'm using the web_reg_save_param_regexp function to capture 8 characters, which contains capital letters and numbers randomly.

I'm using this:

something.*?1-(.*?.{8}) something

and when I replaying the scripts, it said that "The string 8 with parameter delimiters is not a parameter".

The question is that what should I do, because the RB is always different, so I cannot add it 😞

Thanks for the help

 

 

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Correlate with regexp help

Jump to solution

Hi Fecces,

The warning you get, can be ignored. LR tries to match almost anything between { and } as a parameter (on the places where parameterization is allowed).

I see that you try to match 8x times something and not digits/capitals. If you want to do that you need to write '[\dA-Z]{8}'

If you can live with the current anything '.{8}', you might use '\w' instead (also non-capitals) and use '\w\w\w\w\w\w\w\w' as pattern, preventing the '{8}'.

Success, Erik

P.S.

It looks like your pattern takes every thing after first dash '-' after 'something' uptp the first space (after at least 8 characters). Regexp can be hard sometimes. You might find this web-site handy: regex101.

 Note:

If you realy like the '{8}' and want to get rid of the LR-warning you can trick LR:

Just create a parameter '8' with the value '{8}', so it will replace '{8}' with '{8}' 🙂

lr_save_string("{8}","8");

Signature:
Reward community members who take time to respond and help.

View solution in original post

4 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Correlate with regexp help

Jump to solution

Hi Fecces,

The warning you get, can be ignored. LR tries to match almost anything between { and } as a parameter (on the places where parameterization is allowed).

I see that you try to match 8x times something and not digits/capitals. If you want to do that you need to write '[\dA-Z]{8}'

If you can live with the current anything '.{8}', you might use '\w' instead (also non-capitals) and use '\w\w\w\w\w\w\w\w' as pattern, preventing the '{8}'.

Success, Erik

P.S.

It looks like your pattern takes every thing after first dash '-' after 'something' uptp the first space (after at least 8 characters). Regexp can be hard sometimes. You might find this web-site handy: regex101.

 Note:

If you realy like the '{8}' and want to get rid of the LR-warning you can trick LR:

Just create a parameter '8' with the value '{8}', so it will replace '{8}' with '{8}' 🙂

lr_save_string("{8}","8");

Signature:
Reward community members who take time to respond and help.

View solution in original post

Highlighted
Contributor.
Contributor.

Re: Correlate with regexp help

Jump to solution

Hey Erik,

Thanks for the reply.

I'm using this website every time. 🙂

Thanks for the \w idea, I'll use it.

BTW: The LR does not  support the   .{8} format ?

 

Best regards

Fecces

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Correlate with regexp help

Jump to solution

According documentation of web_reg_save_param_regexp() supports LR 'PERL-Compatible Regular Expression'. LR documentation does not mention limitations. So all you test at regex101.com should work.

 
Signature:
Reward community members who take time to respond and help.
Highlighted
Contributor.
Contributor.

Re: Correlate with regexp help

Jump to solution

Thanks for your help! 😉

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.