My regex correlation still captures unwanted data even if I have assertion

     web_reg_save_param_regexp(
        "ParamName=c_NotPostSubTimesheet",
        "RegExp=(?<=\"StartDate\":\")([^\"] )\"(?=.*\"Submitted\":\"[NM]\")",
        "NotFound=warning",
        "Ordinal=All",
        "Group=0",
        SEARCH_FILTERS,
        "Scope=BODY",
        LAST);

This is the JSON where I am trying to apply the assertion:

"StartDate":"2023-10-18","Architectural","Submitted":"N","StatusDesc":"In Progress","Editable":"Y"},{
"StartDate":"2021-01-01","Architectural","Submitted":"Y","StatusDesc":"Submitted","Editable":"Y"},{
"StartDate":"2020-01-01","Architectural","Submitted":"M","StatusDesc":"Missing","Editable":"Y"},{

I only want to extract the StartDate of records with Submitted value of N or M only but when I execute Vugen all StartDate values are captured including the record with Submitted value of Y.

Expected should be:

2023-10-18

2020-01-01

 

 

  • Hi , a good website to test your regexp is regex101.com (but yours is valid).

    One remarks about your regexp: You do not need to use look-ahead around for a simple match. Just the pattern

    "StartDate":"([^\"] )".*"Submitted":"[NM]"

    will be fine.

    Check again the help on web_reg_save_param_regexp(). It states that the default group=1 and that is all you need. group=0, is not what you want.