SoFunction
Updated on 2025-03-09

Introduction to the input attribute ($_) of js regular expressions


<html>
<script language="javascript" type="text/javascript">
//objStr is the content to be matched
var objStr='abcDdefCDDE';
//Create regular expression, i means match ignore case
var re=/cd+e/i;//+ means that the previous sub-match occurs once or more times
(objStr+"<br>");
//Match string
(re);
//The value of this property is a string that matches the regular expression described by the RegExp object.
(+"<br>");
(RegExp.$_+"<br>"); //If the browser does not support this form, try this (RegExp["$_"]);
</script>
</html>