David, Patrick (I/EG-711)
2009-03-03 15:55:05 UTC
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
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 - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss