[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] Need for assistance to seek regex in macro "for
From:       Michaël_Michaud <michael.michaud () free ! fr>
Date:       2007-12-12 20:01:12
Message-ID: 47603E08.5010409 () free ! fr
[Download RAW message or body]

Hi Laurent

Did you try Macro > Grep-like macro

C'est une macro qui recopie dans un nouveau buffer les lignes qui 
correspondent à ton expression régulière

Michaël

LaurentAKEO a écrit :

>hello,
>
>I made this macro to seek text
>but I want to replace the simple text
>
>"(" and "M06"
>
>by a regular expression , like this one for example:
>
>(N*\d*.*(\$.*)|(\(.*\)))|(^N*\d*.*M0*6.*T\d*.*D*\d*)
>
>Can you help me please
>
>and sorry for my bad english....
>
>// ==============================
>// POUR programme NCC
>//  copie les ligne contenant  " ( " et  contenant "M06"
>// dans le presse papier
>
>copyLinesContaining(){
>
>    int count = 0;
>    StringBuffer buff = new StringBuffer();
>    for(int i = 0; i < buffer.getLineCount(); i++){
>        String line = buffer.getLineText(i);
>        if(line.indexOf("(") > -1){
>            buff.append(line).append('\n');
>            count++;
>        }
>    }
>       
>    for(int i = 0; i < buffer.getLineCount(); i++){
>        String line = buffer.getLineText(i);
>        if(line.indexOf("M06") > -1){
>            buff.append(line).append('\n');
>            count++;
>    }
>    }
>    Registers.setRegister('$',buff.toString());
>    HistoryModel.getModel("clipboard").addItem(buff.toString());
>    view.getStatus().setMessageAndClear("" + count + " lines copied");
>}
>copyLinesContaining();
>
>jEdit.newFile(view);
>Registers.paste(textArea,'$',false);
>
>// ==========================================
>
>
>
>-------------------------------------------------------------------------
>SF.Net email is sponsored by: 
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>  
>


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic