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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -