• 0 Votes
    7 Posts
    4k Views
    Eiren SmithE

    Thanks, Scott. I later noticed that. Oh, well.

  • FEATURE REQUEST: Replace and Preserve case

    Locked
    12
    0 Votes
    12 Posts
    6k Views
    guy038G

    Hello, MacGyver27 and All

    Thinking to your problem, I’ve just imagined a particular search/replacement, that changes the case of each letter, of the replacement word, ACCORDINGLY TO the case of each corresponding letter, in the searched word :-)))

    Hypotheses :

    The searched and replacement words are supposed made of any word character. That is to say that they may contain possible digit characters and/or any underscore symbol as, for instance, the words TEST_02 or MY_FUNCTION

    Three cases are possible :

    A) The searched and replacement words have the same size :

    For instance, if the searched word is device, whatever its capitalization form, and the exact replacement word is SySTeM, here are, below, the results of this S/R, for some forms of the searched word :

    DeVIce => SySTem dEVicE => sYSteM devICe => sysTEm dEvIcE => sYsTeM B) The searched word have less letters than the replacement word :

    For instance, if the searched word is device, whatever its capitalization form, and the exact replacement word is lOCatIOn, here are, below, the results of this S/R, for some forms of the searched word :

    DeVIce => LoCAtiOn dEVicE => lOCatIOn devICe => locATiOn dEvIcE => lOcAtIOn

    Note, in that example, that the 7th and 8th remaining letters, of the replacement word, which cannot be associated to a corresponding letter, in the searched word, keep their initial capitalization form !

    C) The searched word have more letters than the replacement word :

    For instance, if the searched word is device, whatever its capitalization form, and the exact replacement word is TeSt, here are, below, the results of this S/R, for some forms of the searched word :

    DeVIce => TeST dEVicE => tESt devICe => tesT dEvIcE => tEsT

    Remarks :

    If a character of the searched word is NOT a letter, the associated character, in the replacement word, will NOT be changed

    If a character of the replacement word is NOT a letter, it will NOT be changed, of course !

    To perform these capitalization changes, TWO consecutive S/R will be mandatory.

    In addition, I need a dummy character, NOT used yet, in your file. I chose the # character, but feel free to chose any other one !

    So :

    Let M be the number of letters of the SEARCHED word

    Let N be the number of letters of the REPLACEMENT word

    Then :

    For case A) ( M = N ) OR case B) ( M < N )

    FIRST S/R :

    SEARCH (?i)\b<SEARCHED word, in ANY case>\b

    REPLACE #<REPLACEMENT word, in ANY case>$0#

    SECOND S/R :

    SEARCH #|(?-is)(?=\w{<N>}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)<SEARCHED word, in ANY case>#

    REPLACE \u(?1\3)\l(?2\3)

    For case C) ( M > N )

    FIRST S/R :

    SEARCH (?i)\b(<The N FIRST letters>)(<The M-N LAST letters>)\b, of the SEARCHED word, in ANY case

    REPLACE #<REPLACEMENT word, in ANY case>\1#\2

    SECOND S/R :

    SEARCH #|(?-is)(?=\w{<N>}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)<The N FIRST letters>#<The M-N LAST letters> , of the SEARCHED word, in ANY case

    REPLACE \u(?1\3)\l(?2\3)

    Then, from the examples, above :

    For case A), from the original text :

    DeVIce
    dEVicE
    devICe
    dEvIcE

    SEARCH (?i)\bdevice\b

    REPLACE #system$0#

    We obtain, after the 1ST S/R :

    #systemDeVIce# #systemdEVicE# #systemdevICe# #systemdEvIcE#

    SEARCH #|(?-is)(?=\w{6}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)device#

    REPLACE \u(?1\3)\l(?2\3)

    And, finally, after the 2ND S/R :

    SySTem sYSteM sysTEm sYsTeM

    For case B), from the original text :

    DeVIce
    dEVicE
    devICe
    dEvIcE

    SEARCH (?i)\bdevice\b

    REPLACE #location$0#

    We obtain, after the 1ST S/R :

    #locationDeVIce# #locationdEVicE# #locationdevICe# #locationdEvIcE#

    SEARCH #|(?-is)(?=\w{8}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)device#

    REPLACE \u(?1\3)\l(?2\3)

    And, finally, after the 2ND S/R :

    LoCAtion lOCatIon locATion lOcAtIon

    For case C), from the original text :

    DeVIce
    dEVicE
    devICe
    dEvIcE

    SEARCH (?i)\b(devi)(ce)\b

    REPLACE #test\1#\2

    We obtain, after the 1ST S/R :

    #testDeVI#ce #testdEVi#cE #testdevI#Ce #testdEvI#cE

    SEARCH #|(?-is)(?=\w{4}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)devi#ce

    REPLACE \u(?1\3)\l(?2\3)

    And, finally, after the 2ND S/R :

    TeST tESt tesT tEsT

    Best Regards,

    guy038

    P.S. : A last example, with my_function_n008 as a searched word and ABCD_123IjklmnOP as a replacement word, which, both, contain 16 characters !

    So, Let’s supposed the example text, below :

    My_Function_N008 mY_fUNCTION_n008 my_FUNCTION_n008 MY_fUnCtIoN_N008

    SEARCH (?i)\bmy_function_n008\b

    REPLACE #ABCD_123IjklmnOP$0#

    We obtain, after this 1ST S/R :

    #ABCD_123IjklmnOPMy_Function_N008# #ABCD_123IjklmnOPmY_fUNCTION_n008# #ABCD_123IjklmnOPmy_FUNCTION_n008# #ABCD_123IjklmnOPMY_fUnCtIoN_N008#

    SEARCH #|(?-is)(?=\w{16}(?:(\u)|(\l)))(\w)(?=\w*#)|(?i)my_function_n008#

    REPLACE \u(?1\3)\l(?2\3)

    And, after the final 2ND S/R :

    AbCD_123ijklMnOP aBCd_123IJKlmnOP abCD_123IJKlmnOP ABCd_123IjKlMnOP
  • option to not re-arrange tab lines

    5
    2 Votes
    5 Posts
    3k Views
    Michael DiGregorioM

    I agree with this post. This behavior is very annoying.

  • Search and focus to open file - Feature request - maybe

    Locked
    1
    0 Votes
    1 Posts
    932 Views
    No one has replied
  • Select Inline text and then add to beginning & end of selection

    Locked
    8
    0 Votes
    8 Posts
    5k Views
    Blair BrennerB

    Thanks guy038!

    Looks good. Will be using this on Monday.

    Best
    Blair

  • Purge Undo

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @John-Ng

    You could do “File” menu -> “Reload from Disk” – this will provide a point from which there is no further undo-ing.

  • Easy feature request: Shortucut key for next tip

    4
    0 Votes
    4 Posts
    2k Views
    cmeriauxC

    I’m just curious, why do you think it’s an easy feature ?

  • CSS Code Coloring for @media directives

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Constant Crashing

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Scott SumnerS

    @Kim-Kløve

    You have the “Show End of Line” feature turned on. Turn off by the “View” menu, “Show Symbol” submenu. Uncheck “Show End of Line”.

  • Notepad++ 7.2.1 Detected as W32.670B0FC09E.ab2 in Cisco Sourcefire AMP

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Trevor AndersonT

    Yes, we are running into this same issue as well.

  • Suggestion for Post-it (F12)

    Locked
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • PluginManager missing on 64bit installer

    Locked
    2
  • sorry, but what difference between 32bit & 64bit versions?

    4
    0 Votes
    4 Posts
    27k Views
    Jorge CornejoJ

    64 bit by some reason doesn’t include Plugin Manager. Just as a software note.

  • "Hide Lines" feature has a bug.

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Alternative Icon

    2
    1 Votes
    2 Posts
    4k Views
    ShaggygoblinS

    Thank you for this!!!
    Using this guide and mentioned tool, I was able to change the icon rather painlessly.

  • npp 7 - regression

    4
    1 Votes
    4 Posts
    5k Views
    Justin KleinJ

    +1 more very disappointed by the icon option’s removal from the installer. Guess I’ll revert to 6.9.2, in which I can have my text document icons look like…text documents… :/

  • howto assingn color for "Strings"/'Strings' and NUMBERS in plain txt file

    6
    0 Votes
    6 Posts
    3k Views
    Claudia FrankC

    @Telealex

    how to assign this new style for all new/opened txt files?

    currently npp doesn’t support a udl to be the default language so you need to tweak it
    like stated here.
    If it is only about already created files you can of course assign an file extension to the
    udl, see udl dialog Ext field.

    q3: is it really needed? I thought multiline is the default behavior. If you still need
    to define eol, here is described how.

    Cheers
    Claudia

  • Suggesting New feature for Color codes (Hex)

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Frank OrellanaF

    Try the Quick Color Picker + plugin. It does basically all that already.

  • Function list with Java problems

    8
    0 Votes
    8 Posts
    8k Views
    Petr SkýpalaP

    Great job. You’re a genius. Making the regex multiline and commentes is real blessing.

    I’ve added several whitespaces \s where i missed them.
    I’ve added bounded templates <T extends A & B>
    I’ve added multiple inheritance - interface can extend multiple interfaces
    I’ve generalized the DECLARATOR and GENERIC groups a bit.

    The result is far from perfect, but it completely satisfies my needs. I don’t mind if it recognizes multiple inheritance. We can leave some work for compiler too. I hope this class-function template will help with other languages.

    <parser displayName="Java" id ="java" > <classRange mainExpr ="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`) ^[\t\x20]* # leading whitespace (?: (?-i: abstract |final |native |p(?:rivate|rotected|ublic) |s(?:tatic|trictfp|ynchronized) |transient |volatile |@[A-Za-z_]\w* # qualified identifier (?: \. [A-Za-z_]\w* )* ) \s+ )* (?-i:class|enum|@?interface) \s+ (?'DECLARATOR' (?'VALID_ID' # valid identifier, use as subroutine \b(?!(?-i: a(?:bstract|ssert) |b(?:oolean|reak|yte) |c(?:ase|atch|har|lass|on(?:st|tinue)) |d(?:efault|o(?:uble)?) |e(?:lse|num|xtends) |f(?:inal(?:ly)?|loat|or) |goto |i(?:f|mp(?:lements|ort)|nstanceof|nt(?:erface)?) |long |n(?:ative|ew) |p(?:ackage|rivate|rotected|ublic) |return |s(?:hort|tatic|trictfp|uper|witch|ynchronized) |th(?:is|rows?) |tr(?:ansient|y) |vo(?:id|latile) |while )\b) # keywords, not to be used as identifier [A-Za-z_]\w* # valid character combination for identifiers ) (?: \s*\x3C # start-of-template indicator (?'GENERIC' # ...match first generic, use as subroutine \s* (?: (?&amp;DECLARATOR) # use named generic | \? # or unknown ) (?: # optional type extension \s+(?-i:extends|super) \s+(?&amp;DECLARATOR) (?: # multiple bounds \s+\x26 # ...are ampersand separated \s+(?&amp;DECLARATOR) )* )? (?: # match consecutive generics objects \s*, # ...comma separated (?&amp;GENERIC) )? ) \s*\x3E # ...end-of-template indicator )? (?: # package and|or nested classes \. # ...are dot separated (?&amp;DECLARATOR) )? ) (?: # optional object extension \s+(?-i:extends) \s+(?&amp;DECLARATOR) (?: # ...match consecutive objects, they are \s*, # separated by a comma \s*(?&amp;DECLARATOR) )* )? (?: # optional object implementation \s+(?-i:implements) \s+(?&amp;DECLARATOR) # ...match first object (?: # ...match consecutive objects, they are \s*, # separated by a comma \s*(?&amp;DECLARATOR) )* )? \s*\{ # whatever, up till start-of-body indicator " openSymbole ="\{" closeSymbole="\}" > <className> <nameExpr expr="(?-i:class|enum|@?interface)\s+\K\w+(?:\s*\x3C.*?\x3E)?" /> </className> <function mainExpr="(?x) # Utilize inline comments (see `RegEx - Pattern Modifiers`) ^[\t\x20]* # leading whitespace (?: (?-i: abstract |final |native |p(?:rivate|rotected|ublic) |s(?:tatic|trictfp|ynchronized) |transient |volatile |@[A-Za-z_]\w* # qualified identifier (?: \. # ... dot separated [A-Za-z_]\w* )* ) \s+ )* (?: \s*\x3C # start-of-template indicator (?&amp;GENERIC) \s*\x3E # end-of-template indicator )? \s* (?'DECLARATOR' [A-Za-z_]\w* # type name (?: # optional parent type name(s) \. # ...parent-sibling separator [A-Za-z_]\w* # ...parent type name )* (?: \s*\x3C # start-of-template indicator (?'GENERIC' # ...match first generic, use as subroutine \s* (?: (?&amp;DECLARATOR) # use named generic | \? # or unknown ) (?: # optional type extension \s+(?-i:extends|super) \s+(?&amp;DECLARATOR) (?: # multiple bounds \s+\x26 # ...are ampersand separated \s+(?&amp;DECLARATOR) )* )? (?: # match consecutive generics objects \s*, # ...comma separated (?&amp;GENERIC) )? ) \s*\x3E # ...end-of-template indicator )? (?: # package and|or nested classes \. # ... are dot separated (?&amp;DECLARATOR) )? (?: # optional compound type \s*\[ # ...start-of-compound indicator \s*\] # ...end-of-compound indicator )* ) \s+ (?'VALID_ID' # valid identifier, use as subroutine \b(?!(?-i: a(?:bstract|ssert) |b(?:oolean|reak|yte) |c(?:ase|atch|har|lass|on(?:st|tinue)) |d(?:efault|o(?:uble)?) |e(?:lse|num|xtends) |f(?:inal(?:ly)?|loat|or) |goto |i(?:f|mp(?:lements|ort)|nstanceof|nt(?:erface)?) |long |n(?:ative|ew) |p(?:ackage|rivate|rotected|ublic) |return |s(?:hort|tatic|trictfp|uper|witch|ynchronized) |th(?:is|rows?) |tr(?:ansient|y) |vo(?:id|latile) |while )\b) # keywords, not to be used as identifier [A-Za-z_]\w* # valid character combination for identifiers ) \s*\( # start-of-arguments indicator (?'ARG' # ...match first argument, use as subroutine \s*(?-i:final\s+)? (?&amp;DECLARATOR) \s+(?&amp;VALID_ID) # argument name (?: # ...consecutive arguments are \s*, # separated by commas (?&amp;ARG) )? )? \) # end-of-arguments indicator (?: # optional exceptions \s*(?-i:throws) \s+(?&amp;VALID_ID) # ...first exception name (?: # ...consecutive exception names are \s*, # separated by commas \s*(?&amp;VALID_ID) )* )? \s*(?: # function declaration ends with ... \{ # ...a start-of-function-body indicator or | ; # ...an end-of-declaration indicator ) " > <functionName> <funcNameExpr expr="\w+(?=\s*\()" /> </functionName> </function> </classRange> </parser>
  • Crashing Final Fantasy XIV

    Locked
    2