DRF, 001.html <form style="float: left;" action="614.html" method="get"> <input name="commit" type="submit" value="Back" /></form>
002.html <form style="float: left;" action="pulm123.html" method="get"> <input name="commit" type="submit" value="Back" /></form> 003/html <form style="float: left;" action="pulm495.html" method="get"> <input name="commit" type="submit" value="Back" /></form> How do I delete this two lines from every html file? Each html file has a different number in its code. ANSWER : 'pulm' does not exist in 001.html, but it does in 002.html and 003.html this handles leading spaces ^[ \t]* so this takes care of that possibility [pulm]* this handles one or more digits [\d]+ assuming there are no leading, or trailing spaces SEARCH : <form style="float: left;" action="[pulm]*[\d]+\.html" method="get">\r<input name="commit" type="submit" value="Back" /></form> REPLACE : If there are leading or trailing spaces then SEARCH : ^[ \t]*<form style="float: left;" action="[pulm]*[\d]+\.html" method="get">[ \t]*\r[ \t]*<input name="commit" type="submit" value="Back" /></form>[ \t]* REPLACE : If you knew that this was the only form in each page, then you could do : SEARCH : <form[^\r>]+>[ \t]*\r[ \t]*<input[^\r>]+></form>[ \t]* REPLACE : This will also work, but is greedier, so I prefer the ones above. SEARCH : ^\s*<form[^\r>]+>\s*\r\s*<input[^\r>]+></form>\s* REPLACE : broken down : <form[^\r>]+> means get anything that starts with '<form' followed by any characters that are not either '>' or a return char followed by '>'. <form style="float: left;" action="pulm123.html" method="get"> [ \t]* means any trailing spaces \r a return character [ \t]* any leading spaces <input[^\r>]+> means get anything that starts with '<input' followed by any characters that are not either '>' or a return char followed by '>'. <input name="commit" type="submit" value="Back" /> </form> [ \t]* This wasn't a very good explanation, but it's late and I am tired. Bood Luck, Bill Hernandez Plano, Texas On Nov 23, 2009, at 4:59 PM, drftorres wrote: > I have more than 100 html files and need to delete two lines within > the code. The two lines are not always in the same line #. I want to > delete this two lines of code from every html files but it have been > difficult because the code have three different numbers. > > Examples: > > 001.html > <form style="float: left;" action="614.html" method="get"> > <input name="commit" type="submit" value="Back" /></form> > > 002.html > <form style="float: left;" action="pulm123.html" method="get"> > <input name="commit" type="submit" value="Back" /></form> > > 003/html > <form style="float: left;" action="pulm495.html" method="get"> > <input name="commit" type="submit" value="Back" /></form> > > How do I delete this two lines from every html file? Each html file > has a different number in its code. > -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/bbedit?hl=en If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
