Menu

can NP++'s keywords support regular exp?

2007-10-10
2012-11-13
  • Nobody/Anonymous

    i dont know whether NP++ supports the regular expression?

    if support how can i do?

    thanks very much.

     
    • Nobody/Anonymous

      What do you mean "can NP++'s keywords support regular exp"?
      If you mean additional keywords, which you can type in Style configurator, than answer is No. They (or maybe some of them - depending on lexer) only support ^ symbol which means "starts with". So that "^some" will match "something" and "someword".

       
    • Nobody/Anonymous

      >RE: can NP++'s keywords support regular exp? (New)
      >By: Nobody/Anonymous (nobody) - 2007-10-10 01:55 
      >What do you mean "can NP++'s keywords support regular exp"?
      =======================================
      i use a language named *.SP and *.CIR file which is used in electronic circuit design. i define keyword by myself. in this type of files i want to highlight some speacial words(keyword) such as

      *
      Vbatt VBATT 0   batt pwl 0 2 10m 5.0
      Vin VIN 0   dvin pwl 0 0 10u dvin
      eVddp VDDP 0   vin 0 1 max=5.26
      *

      i want to highlight those word: 1. must be at the begin of one line; 2. all words whose first letter is "v". so, if using regular exp, the syntax is "^v*".

      >If you mean additional keywords, which you can type in Style configurator, than answer is >No. They (or maybe some of them - depending on lexer) only support ^ symbol which >means "starts with". So that "^some" will match "something" and "someword". 

      i can see many default language in style configurator, but as for user definfed language i can not see anything.

       
    • Nobody/Anonymous

      Using regex it'll be "^v.*". But no, keywords don't support it. All that you can do - is to highlight EVERY word starting with "v" - simply check "prefix" checkbox and type "v" in keywords group. To do something more comlex you'll need to write your own lexer and add support for it to NP++ sources.

       
    • Nobody/Anonymous

      yes,(simply check "prefix" checkbox and type "v" in keywords group) is a compromise. but it is dispirited for me to highlight all words starting with "v".

      so if np++ support reg exp it will be more powerful!

       
MongoDB Logo MongoDB