Discussion:
Question to syntax highlighting
David, Patrick (I/EG-711)
2009-06-18 14:57:55 UTC
Permalink
Hello out there,

I use nedit to work on input files for the software ABAQUS (a finite
element solver).
I want to teach my nedit to highlight different keywords in a
non-case-sensitive way. For example the words "step" shall be
highlighted independet of upper or lower cases. So "Step" is also a
valid keyword as "step" or "STEP" or "sTep" or ...

I am not very familiar with regex so I have my problems with it. Can you
help me to build it? I hope for a simple solutions becaus my list of
keywords is long...

hfh
Greetings from
Patrick
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Eddy De Greef
2009-06-18 16:52:14 UTC
Permalink
Hi,

the pattern that you need is something like

(?i<step|and|all|your|other|keywords>)

Legend:
(?i...) -> case insensitive
<...> -> word boundaries
...|... -> or

Eddy
Post by David, Patrick (I/EG-711)
Hello out there,
I use nedit to work on input files for the software ABAQUS (a finite
element solver).
I want to teach my nedit to highlight different keywords in a
non-case-sensitive way. For example the words "step" shall be
highlighted independet of upper or lower cases. So "Step" is also a
valid keyword as "step" or "STEP" or "sTep" or ...
I am not very familiar with regex so I have my problems with it. Can you
help me to build it? I hope for a simple solutions becaus my list of
keywords is long...
hfh
Greetings from
Patrick
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Tim Hubberstey
2009-06-19 00:32:53 UTC
Permalink
Post by David, Patrick (I/EG-711)
Hello out there,
I use nedit to work on input files for the software ABAQUS (a finite
element solver).
I want to teach my nedit to highlight different keywords in a
non-case-sensitive way. For example the words "step" shall be
highlighted independet of upper or lower cases. So "Step" is also a
valid keyword as "step" or "STEP" or "sTep" or ...
I am not very familiar with regex so I have my problems with it. Can you
help me to build it? I hope for a simple solutions becaus my list of
keywords is long...
hfh
Greetings from
Patrick
I've found that the easiest way to build a syntax pattern is to start with
the pattern for a language that is similar to your target and modify it. In
your case, a non-case-sensitive keyword-oriented language like Ada or VHDL
is probably a good starting place.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Continue reading on narkive:
Loading...