RE: How to select multiple lines
Matthijs van Aalten <[email protected]>
| Newsgroups | gmane.editors.nedit.user |
|---|---|
| Message-ID | <A2403073D589354FB342892C1CB8F90607D7A8639E@EU1RDCRDC1WX029.exi.nxp.com> |
Hi, Ah, you want lazy matching instead of greedy... Search for: "(?n(^module toto;\n).*?(^endmodule\n))" Replace with: "\1\2" Adding a "?" to a ".", "*" or "?" will match as little as possible, instead of the default as much as possible. Regards, Matthijs -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Eric Bouyoux Sent: Tuesday 8 September 2009 15:37 To: General NEdit discussion list Subject: Re: How to select multiple lines Hi, Thank you for all the explanations. I knew I could use keywords (module and endmodule) and then the ^M key (go to matching). These 2 keywords are not recognized in my nedit environment but I know how to make it work. But I wanted something more general such as Matthijs van Aalten's regular expression in a "Replace" window "(?n(^module toto ;\n).*(^endmodule\n))" but it does not exactly works the way I want. It starts from the first "module" found and goes to the very last "endmodule" in the file. I want it to stop at the FIRST "endmodule" encountered. I tried several changes in the reg exp but I could not make it work. Any idea ? Regards. Eric Bouyoux. -- NEdit Discuss mailing list - [email protected] http://www.nedit.org/mailman/listinfo/discuss -- NEdit Discuss mailing list - [email protected] http://www.nedit.org/mailman/listinfo/discuss