Service Virtualization

Expand all | Collapse all

Regular expression in the assertion

Jump to Best Answer
  • 1.  Regular expression in the assertion

    Posted 04-11-2018 08:23 AM

    Ensure the result contains expression.. How can I give expression in such a way that I need to search for a particular string in the message?

     

    Ex: 

     

    Result is as below:

    12345

    AFGSF

    312747346

     

    If I want to search for AFGSF. How to provide regular expression?

     

    I tried *.AFGSF.*

    Its not working.



  • 2.  Re: Regular expression in the assertion

    Posted 04-11-2018 02:27 PM

    import java.util.regex.*; 

    Pattern.matches("your String""[a-zA-Z]")



  • 3.  Re: Regular expression in the assertion

    Posted 04-11-2018 04:05 PM

    Hi,

         Directly search for "AFGSF".

    Vish



  • 4.  Re: Regular expression in the assertion
    Best Answer

    Posted 04-11-2018 04:36 PM

    To search for exact word AFGSF, in Ensure the result contains expression the regular expression needs to AFGSF

     

    There is a Regular Expression Helper under Help menu which can be used to validate what regular expression would match in a given string.



  • 5.  Re: Regular expression in the assertion

    Posted 04-12-2018 01:53 AM

    Thanks everyone. Its working