Created
June 19, 2014 21:47
-
-
Save loadster/4e15b1b6bf9706c0a99d to your computer and use it in GitHub Desktop.
Validate a response contains a string that matches a regular expression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validate(response) { | |
var regex = /Confirmation #AWB(\d{8})Z/gm; | |
var matched = regex.test(response.bodyAsString); | |
return matched; // Validation is successful if the regex matched | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment