2

Below is the string:

id='PMN_PRCSLIST_BEGINDTTM'>06/13/2018&nbsp; 6:35:00AM EDT</span>

From which i want to extract 6:35:00AM.
How do i achieve it using loadrunner?
I have tried doing:

id='PMN_PRCSLIST_BEGINDTTM'>(\\d:\\d\\d:\\d\\dAM)</span>"

But it did not helped me.

Vishal Chepuri
  • 306
  • 5
  • 26

2 Answers2

1

You may add .* to match any chars in between > and the time, and between AM and <:

id='PMN_PRCSLIST_BEGINDTTM'>.* (\\d\\d?:\\d\\d:\\d\\d[AP]M).*</span>

Note you should add a space after the first .* since you may have 2 digits in the hour part and to match 1 or 2, you need \d\d?. To match PM or AM, use [PA]M.

Note that if the space before the time is optional, use lazy dot after >:

id='PMN_PRCSLIST_BEGINDTTM'>.*?(\\d\\d?:\\d\\d:\\d\\d[AP]M).*</span>
                              ^ 

See the regex demo

Besides, if you want to stay within 1 tag value, replace .* with [^<]*.

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
  • How do i exclude " " from "06/13/2018  6:35:00AM EDT" and only capture "06/13/2018 6:35:00AM" @WiktorStribiżew – Vishal Chepuri Jun 14 '18 at 13:00
  • @VishalCruise It is not possible to match discontinuous texts within 1 match operation, you need to post-process the match to either remove that substring or convert to the real space (  is actually a non-breaking space). – Wiktor Stribiżew Jun 14 '18 at 13:05
0

You have a far simpler path without regular expressions. Check out the parameters for web_reg_save_param(_ex)

LB=id='PMN_PRCSLIST_BEGINDTTM'>
RB=</span>
SaveOffset=18
James Pulley
  • 5,606
  • 1
  • 14
  • 14