pattern - tests if the value matches the pattern

condition: {
when: 'Foo',
pattern: /bar/,
}
// Foo = 'bar' => true
// Foo = 'baar!' => false

It also accepts string value, then you have to use additional property flags if you need to specify RegExp flags:

condition: {
when: 'Foo',
pattern: 'bar',
flags: 'i'
}
// Foo = 'bar' => true
// Foo = 'bAr!' => true