Intercept the fg on the right side of abcdefg
Method 1
<script> <br>string="abcdefg" <br>alert(string.substring(string.length-2,string.length)) <br></script>
Method 2
<script> <br>alert("abcdefg".match(/.*(.{2})/)[1]) <br></script>
<script> <br>alert("abcdefg".match(/.{2}$/)) <br></script>
Method 3