Skip to content Skip to sidebar Skip to footer

Html Search And Replace On Server Side

I like to search something like stack <'sometag'> overflow and replace with stack <'sometag'>underflow It is part of a large html te

Solution 1:

I would be somewhat wary of doing regexps to change an HTML file. Too many things would go wrong.

Are your HTML files XML compliant? (e.g., XHTML?). In that case, you might be better off doing XML level transformations, with either XSL or a query based parser.

Solution 2:

Take look on http://jsoup.org/ It does all kinds of stuff with tags.

Post a Comment for "Html Search And Replace On Server Side"