Finding line beginning using regular expression

后端 未结 5 750
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-31 04:45

Finding Line Beginning using Regular expression in Notepad++

I want to strip a 4000-line HTML file from all the jQuery "done" attributes in a div.

5条回答
  •  天命终不由人
    2020-12-31 05:22

    I like Notepad++ too but the regexing is really a pain. If you insist on using Notepad++ try this:

    • First find out which newline characters are being used in your document (View>Show Symbol>Show End Of Line)
    • Delete those line-breaks by replacing them with a single space (Search and replace. CR is \r LF is \n. Be sure to tick "Extended" search mode)
    • Regex-replace done[0-9][0-9]*=\"[0-9][0-9]*\" with the empty string (be sure to put a single space before the regex expression)

    Voila! Not very nice n clean but it works ;o)

    After that if you want it human-readable again you could use the HTMLTidy functions

提交回复
热议问题