Microsoft
Software
Hardware
Network
Question : Regex newbie question
Hello - hoping somone can help:
looking for a regular expression that can reaplce everything between two matching strings - for example- lets say I have a number of html pages of varying length and I wanted to remove everything between the body tags.
So I would start with this:
<html>
<body>
interesting information<br>
some more stuff
</body>
</html>
And end with this:
<html>
<body>
</body>
</html>
It should work for matching between any two strings - like between html tags or html comments and there would be a varying number of lines between the start and end string.
Basicaaly I want to find: <body>.*</body>
but i cant seem to account for the varying numbers of newlines.
Thanks for your help!
Answer : Regex newbie question
If you tried Programmer's Notepad (I just downloaded it), change the pattern to either:
(?s)<body>.*?</body>
or
<body>[\s\S]*?</body>
and you will match the desired text.
Random Solutions
Visual Studio 2008 Threading Window
Best use of a SATA 6g/s hard drive?
Netlogon Service stopped on SBS2003
Moved a Dolpin 7 website to a new server and I get an error message.
access 2k7 split DB with Runtime frontend
2008 query in 2000
Transition or Restructure 2003 to 2008 R2 AD? Migrate Exchange 2003 or just move to 2010?
hackintosh for eee pc 1001ha
Increment Value
Need app to automatically turn off iphone at location