String match pattern: (.*) : Regular Expressions « Development « JavaScript DHTML
- JavaScript DHTML
- Development
- Regular Expressions
String match pattern: (.*)
<html>
<head>
<script type="text/javascript">
var pattern = /is (.*) test/;
var string = "this is a test";
var result = string.replace(pattern, "not unit $1 test");
document.write(result);
</script>
</head>
<body>
</body>
</html>
Related examples in the same category