Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Deleting all lines starting with // in all the java files of a java project
Deleting all lines starting with // in all the java files of a java project [message #326012] Wed, 05 March 2008 17:08 Go to next message
Eclipse UserFriend
Originally posted by: none.domain.invalid

Hi,
i'd like to delete all the lines in java files wich start with "//".

I've tried to use the following regexp:
Search ([\r\n]+)//.*$
Replace $1

But in the preview, the lines are replaced with empty lines. Is this a bug or is there another regexp to use ?

TIA
Re: Deleting all lines starting with // in all the java files of a java project [message #326044 is a reply to message #326012] Thu, 06 March 2008 09:18 Go to previous message
Owen Rees is currently offline Owen ReesFriend
Messages: 41
Registered: July 2009
Member
Name <none@domain.invalid> writes:

> Hi,
> i'd like to delete all the lines in java files wich start with "//".
>
> I've tried to use the following regexp:
> Search ([\r\n]+)//.*$
> Replace $1
>
> But in the preview, the lines are replaced with empty lines. Is this a bug or is there another regexp to use ?
>
> TIA

The Replace says to keep the \r and \n characters so that is what is
happening. Just replacing with nothing will delete all the \r and \n
immediately before the // which should delete the // line and all
completely blank lines before it. If that is not what you want, then
search for a single end of line sequence before the // and replace
with nothing.

--
Owen Rees; speaking personally, and not on behalf of HP.
========================================================
Hewlett-Packard Limited. Registered No: 690597 England
Registered Office: Cain Road, Bracknell, Berks RG12 1HN
Previous Topic:[DataBinding] DOM & XAML binding and bugs correction
Next Topic:3.3 migration
Goto Forum:
  


Current Time: Sun Jul 07 09:26:14 GMT 2024

Powered by FUDForum. Page generated in 0.03861 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top