Skip to content

Commit ee4cae0

Browse files
committed
Update regex examples to be more durable
Change will match exactly one of options and not contains. Update example to match a specific type and not just includes text
1 parent fd3c14d commit ee4cae0

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ Example synchronous message:
448448
"matchers": [
449449
{
450450
"match": "regex",
451-
"regex": "CONTENT_MATCHER|CONTENT_GENERATOR"
451+
"regex": "^(CONTENT_MATCHER|CONTENT_GENERATOR)$"
452452
}
453453
]
454454
}

testcases/message/body/matches with regex.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
"matchers": [
3131
{
3232
"match": "regex",
33-
"regex": "red|blue"
33+
"regex": "^(red|blue)$"
3434
}
3535
]
3636
},
3737
"$.alligator.favouriteColours[1]": {
3838
"matchers": [
3939
{
4040
"match": "regex",
41-
"regex": "red|blue"
41+
"regex": "^(red|blue)$"
4242
}
4343
]
4444
}

testcases/request/body/matches with regex xml.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"matchers": [
2121
{
2222
"match": "regex",
23-
"regex": "red|blue"
23+
"regex": "^(red|blue)$"
2424
}
2525
]
2626
}

testcases/request/body/matches with regex.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"matchers": [
2121
{
2222
"match": "regex",
23-
"regex": "red|blue"
23+
"regex": "^(red|blue)$"
2424
}
2525
]
2626
},
2727
"$.alligator.favouriteColours[1]": {
2828
"matchers": [
2929
{
3030
"match": "regex",
31-
"regex": "red|blue"
31+
"regex": "^(red|blue)$"
3232
}
3333
]
3434
}

0 commit comments

Comments
 (0)