WG: Problems with regex

"David, Patrick (I/EG-711)" <[email protected]>
Newsgroups gmane.editors.nedit.user
Message-ID <[email protected]>
Hello out there,

I want to extend my macro library to make nedit able to deal with *.inp
Files (this extension is used by the commercial Finite-Element-Method
software Abaqus).
First I want to teach nedit how to deal with comments in these files. A
commented line starts with two asterisks (**). My macro line for
automatic commenting is the following:

replace_in_selection("^.*$", "** $", "regex")

which seems to work. My problem: how can I program a macro to remove the
first 2 asterisks in a line?
My first shot

replace_in_selection("(^[ \\t]*[\*\*] ?)(.*$)", "\\2", "regex")

doesn't work. I don't have experiences with this function (what does
"\\2" mean)?

In addition it's probably important to know that keywords in Abaqus
starts with a single asterisk. Example:

Original:
----------------------
*STEP, NAME=myStep
My Step Description
*STATIC
*LOAD
1, 1
*END STEP

Commented:
-------------------------
***STEP, NAME=myStep
**My Step Description
***STATIC
***LOAD
**1, 1
***END STEP

Has anyone of you an idea for the uncommenting macro function?
Hope for help
Patrick

-- 
NEdit Discuss mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.