Service Virtualization

 View Only
  • 1.  Regular expression in selective match style is now working

    Posted 25 days ago

    Noticed that virtual services are not matching the right transaction in the selective match style when one of the incoming arguments is set to a regular expression ([0-9]). The same transaction works when the value is set to anything instead of a regular expression.

    any suggestion how can we pass value to regular expression in selective match ?



  • 2.  RE: Regular expression in selective match style is now working

    Broadcom Employee
    Posted 25 days ago

    Hi Vikram,

    Whar the values you are trying to match in the Regular Expression? Please give some examples.

    Prema




  • 3.  RE: Regular expression in selective match style is now working

    Posted 25 days ago

    Hello Prema,

    below are the few use case 

    "instructedAmount": "12000",
    "instructedAmount": "10",
    "instructedAmount": "121.03",
    Thanks 
    Vikram 



  • 4.  RE: Regular expression in selective match style is now working

    Broadcom Employee
    Posted 25 days ago
    Hi Vikram,

    I've used the regular expression operator many times and always got it to
    work, so we'll have to figure this one out.

    Are you sure that the length of the incoming field is only one character
    long? Maybe there are space after the digit?

    You could try: [0-9]\s*
    Or also: \d\s*

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.




  • 5.  RE: Regular expression in selective match style is now working

    Posted 25 days ago

    This worked , how can allow decimals as well in the same regular expression ?

    Thanks 

    Vikram




  • 6.  RE: Regular expression in selective match style is now working
    Best Answer

    Broadcom Employee
    Posted 25 days ago
    Hi Vikram,

    Try this one: \d+(\.\d+)?\s*

    It is one of the most simple ones. Maybe it satisfies your requirements?
    There are different rules about what is accepted as a valid decimal number.
    Example,

    - .32 to be accepted? (decimal with no digit before the decimal point)
    The above regex will not accept it.
    - any number of digits after the decimal point to be accepted? For the
    above, 123.1 will be accepted, but also 123.654321 will be accepted.


    If the requirement would be to have always 2 digits (no more, no less)
    after the decimal point then try this one: \d+(\.\d\d)?\s*

    Cheers,

    Danny Saro

    Client Services Consultant

    Broadcom Software


    -------------------------------------------------

    --
    This electronic communication and the information and any files transmitted
    with it, or attached to it, are confidential and are intended solely for
    the use of the individual or entity to whom it is addressed and may contain
    information that is confidential, legally privileged, protected by privacy
    laws, or otherwise restricted from disclosure to anyone else. If you are
    not the intended recipient or the person responsible for delivering the
    e-mail to the intended recipient, you are hereby notified that any use,
    copying, distributing, dissemination, forwarding, printing, or copying of
    this e-mail is strictly prohibited. If you received this e-mail in error,
    please return the e-mail to the sender, delete it from your computer, and
    destroy any printed copy of it.