# Assert that value in response matches one of regex values in array

**URL:** <https://community.postman.com/t/assert-that-value-in-response-matches-one-of-regex-values-in-array/32020>\
**Category:** Help Hub\
**Created:** [January 28, 2022, 5:19pm UTC](https://community.postman.com/t/assert-that-value-in-response-matches-one-of-regex-values-in-array/32020 "2022-01-28T17:19:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BonnieThorne](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@BonnieThorne](https://community.postman.com/u/BonnieThorne)\
**Post date:** [January 28, 2022, 5:19pm UTC](https://community.postman.com/t/assert-that-value-in-response-matches-one-of-regex-values-in-array/32020/1 "2022-01-28T17:19:51Z")

</div>

I have an array of regex strings that match possible values in a response  
ie  
let bathroom\_values = [/^Bathroom=Full ([0-9])$/, /^Bathroom=1/2 ([0-9])$/, /^Bathroom=3/4 ([0-9])$/, /^Bathroom=1.5 ([0-9])$/]

I have confirmed that these are valid. The first regex value in the array matches the value in the response which is Bathroom=Full (2)

How do I check that the value in the response which is bathroom matches one of the values in the array?  
I tried pm.expect(bathroom).to.match(/^Bathroom=Full ([0-9])$/) and that passes so Im assuming I just cant find the correct assertion.  
Trying to.be.oneOf fails with AssertionError: expected [‘Bathroom=Full (2)’] to be one of [Array(4)]

Hopefully I included enough information. Thank you in advance!
