Find Exact Match From Page Using Javascript Regex -
how find exact match whole html.below detail explanation. suppose have html below:
<html> <body> ..... <table> <tr> <td> linenumber </td> <td> number </td> </tr> </table> ..... </body> </html>
here want replace 'number' word. can using .replace(/number/g,'newnumber')
using changing value in 'this linenumber' statement, convert statement 'this linenewnumber'.
i don't want it. need change there single 'number',not word.
you want match word boundaries using \b
:
.replace(/\bnumber\b/g, 'newnumber');
Comments
Post a Comment