RegExp.$` (4) : RegExp Object : Regular Expressions JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Regular Expressions » RegExp Object »

 

RegExp.$` (4)








The RegExp.$` property represents the substring preceding the most recent pattern match.

This is the same as using the leftContext property.












<html>
    <body>
    <script language="JavaScript">
    <!--
        pat = /is*/g;
        var str = "This is a test.";
        myArray = pat.exec(str);
    
        document.write("In the string: " "<b>");
        document.write("I know where the fish is tonight" "</b><br><br>");
        document.write("The RegExp.leftContext is: " + RegExp.leftContext);
    -->
    </script>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Regular Expressions
» RegExp Object