Basic RegExp Pattern

Create a simple regular expression and test a string.

Preview

Code

<script>
let pattern = /hello/;

console.log(pattern.test("hello world"));
</script>

More JS RegExp Examples (7)