• functionList.xml - more different 'function' definitions?

    8
    0 Votes
    8 Posts
    3k Views
    guy038G

    Hello, gehe-online,

    The crypto writing of regexes, as you say, are not that difficult. Just an other language, as thousand other ones !

    Regarding the regex, in your functionList.xml file, below :

    mainExpr=" (?x) # free-spacing (see `RegEx - Pattern Modifiers`) (?ms) # - ^, $ and dot match at line-breaks ^\h* # optional leading white-space at start-of-line (?:beginsub\s+)? name\s*=\s* \K # discard text matched so far [\w.^+-]+ "

    Here are some non exhaustive explanations, on this regex :

    First, the (?x) modifier tell the regex engine that the free-spacing mode is ON So, any non-escaped space character, as well as comments, beginning with the # symbol, will be ignored

    Then, the (?ms) modifiers, which could be rewritten (?m)(?s), means that :

    The ^ and $ assertions represent, respectively, any start and end of line ( (?m) )

    The dot . special character matches any single character, even an End of line one, like \r and \n ( (?s) )

    Now, the part ^\h* represents any sequence, even empty, of horizontal blank characters, at start of line ( note that * is a shortcut for the {0,} quantifier, meaning present 0 or any time )

    Afterwards, the (?:beginsub\s+)? searches for the beginsub key-word, in any case, followed by, at least, one blank character, as the + quantifer is a shortcut of the {1,} one.

    As that range is enclosed in a non-capturing group (?.....), followed with the ? quantifier ( which is a shortcut of {0,1} ) this implies that the part beginsub\s+ may be present or not

    Then, the name\s*=\s* part tries to catch the name key-word, followed by optional blanks chars, then the = sign, and followed, again, with optional blanks chars

    Now, The \K syntax, tell the regex engine to forget anything matched, so far ! Note that the previous match was mandatory to get an overall match but, now, the regex engine just has to consider the remaining of the regex

    Thus, the final part, to match, is the regex [\w.^+-]+ which represents a character class feature, that is to say, a single character, enclosed in the [....] structure, which must be present, at least, one time ( remember, + == {1,} quantifier )

    To end with, any single character, which composes the name, of each key-word NAME, can be, either :

    A word character ( \w ), that is to say, a classical letter, an accentuated letter, a digit or the _ symbol

    A circumflex accent ( ^ )

    A dot punctuation sign ( . )

    A plus mathematical sign ( + )

    A minus mathematical sign ( - )

    Remark : for further information on Unicode Blank characters, refer, also, to the link, below :

    https://notepad-plus-plus.org/community/topic/15279/unicode-blank-characters-and-the-regexes-h-v-and-s/1

    gehe online, I hope that, now, you can figure out the general template of a regular expression !

    Best Regards,

    guy038

    P.S. :

    For noob people, about regular expressions concept and syntax, begin with that article, in N++ Wiki :

    http://docs.notepad-plus-plus.org/index.php/Regular_Expressions

    In addition, you’ll find good documentation, about the Boost C++ Regex library, v1.55.0 ( similar to the PERL Regular Common Expressions, v5.8 ), used by Notepad++, since its 6.0 version, at the TWO addresses below :

    http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

    http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html

    The FIRST link explains the syntax, of regular expressions, in the SEARCH part

    The SECOND link explains the syntax, of regular expressions, in the REPLACEMENT part

    You may, also, look for valuable information, on the sites, below :

    http://www.regular-expressions.info

    http://www.rexegg.com

    http://perldoc.perl.org/perlre.html

    Be aware that, as any documentation, it may contain some errors ! Anyway, if you detected one, that’s good news : you’re improving ;-))

  • Toggle Single Line Comment vs Single Line Comment? Why do we have both?

    8
    1 Votes
    8 Posts
    3k Views
    Claudia FrankC

    @Ahu-Lee

    to be honest, I don’t do much html and because of that I never checked what the issue here
    is, it might be npp or it might scintilla, but yes, it is inconsistent in that case.

    Cheers
    Claudia

  • Doubleclick on delimiter

    Locked
    10
    0 Votes
    10 Posts
    3k Views
    A KA

    @dail said:

    Settings > Preferences > Delimiter > Allow on several lines

    It solves almost all problems!
    In this case, we only need an option that sets whether to select delimiters or not.

    Of course Scott is right, delimiters should be assigned to the current language. Or at an additional setting.

    And further. It would be nice to have [ctrl + alt + b] work anywhere between the parentheses (like dblclck + ctrl). In this case, if you press [ctrl + alt + b] several times, the selection should expand to the next and next delimiters.

  • 0 Votes
    2 Posts
    1k Views
    Scott SumnerS

    @Ryan-Lloyd

    So here’s how it works. It takes your selection and assumes that you want to open that as a file (or files). If your selection contains spaces and doesn’t have double quotes, then each space-separated “token” will be considered a different file. If each token doesn’t contain path information, Notepad++ will attempt to open that “file” in the current folder (which in the portable install I use, is the folder that Notepad++.exe lives in). If the “intended” file isn’t found, Notepad++ will prompt to create it.

    I think this as described is what you are seeing. I don’t think of it as a “bug”, but maybe just something that is less than ideal. :-)
    If you are going to use this feature, I’d suggest being careful about what text is selected when you activate it.

    Contrast this behavior with the right-click (in a document tab window) entry Open File. There, if you have a similar selection when invoking the feature, you get a popup box that says The file you’re trying to open doesn’t exist. Perhaps it would be better if the Run menu’s version worked similarly…

  • Match and replace specific word between two tag symbol

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    guy038G

    Hello, @jade-owen,

    I’m a bit perplexed ! Indeed, from your example, it looks as you would change the upper-case string ROOM with the upper-case string SPACE, when within a <div>.......</div> range, only… and NOT the LOCAL string !!

    If it’s really what you want, the regex, below, should do the job, strictly !

    SEARCH (?-is)(<div>.*?LOCAL..-)(.*?)(?=..-.*?</div>)

    REPLACE \1SPACE

    OPTIONS Tick the Wrap around and Regular expression options

    ACTION Click, once, on the Replace All button, or several times on the Replace button

    Best Regards,

    guy038

    P.S. :

    Generally speaking, it’s important to point out that regexes are very dependent of the text they are applying against ! Even a simple additional space character, in a text, can break out matches detection of a well-formed regex !

    So, I advice everyone, which wants a specific search/replacement, to carefully describe :

    The searched text which must be matched

    The replacement text which will be inserted, instead

    Doing this way should help out to build the right regex(es) and assures you to get a quicker solution, too ;-))

  • Bug (?) Window title with Unicode filename shows ???????.??? v7.5.4

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Stephan-Hodges said:

    looks like mine is behaving differrent, the window title shows the symbols but the tab text doesn’t.
    Maybe related to the fact that I’m using Linux/Wine.
    Unfortunately the setting to change the tab text is deactivated.

    As of screenshots, you are right, you can’t attach in the forum but what you can do is to upload
    to image hosters like imgur and use a sysntax like

    ![](https://i.imgur.com/g5lKm4K.png)

    and you get a result like this

    Cheers
    Claudia

  • Notepad++ does not allow a default page orientation

    3
    0 Votes
    3 Posts
    4k Views
    raj66kasR

    There is no page orientation settings at the file level. When printing a file, you can use the printer driver settings to print in the Landscape mode.

  • Will Notepad ++ save a notepad (windows version ) file?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    DaveOnGitHubD

    Thanks for getting back to me. What I want is to use Microsoft Notepad and have Notepad++ save the file every so often. Something caused Windows to shut down and I don’t think it was me. I lost a document that I had not saved for a while. So I’m trying to avoid that in the future.
    I will look at what you have suggested. To be frank though, I have no clue what to disable. As to the 7z format you speak of, I have no idea what you are talking about. I found a download button on the website and clicked it. I clearly have some homework to do. Please stay in touch. I will write when I have a better understanding of the program. Thanks, Dave

  • Crash DSpellCheck.dll

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    chcgC

    Known issue with dspellcheck 1.3.2, use 1.3.4 or later, see https://github.com/Predelnik/DSpellCheck/releases. Notepad++ 7.5.4 should be bundled already with dspellcheck version 1.3.4.

  • Changing police character

    5
    0 Votes
    5 Posts
    2k Views
    Gilles ToubolG

    Thanks that’s perfect.

  • Run a command using custom toolbar button?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Ahu LeeA

    UPDATE

    Solved!

    Please delete this post.

  • Notepad++ Version Standardization request

    Locked
    1
    1 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    6 Posts
    2k Views
    guy038G

    Hello, @laurent-coulon, @peterjones and All,

    Even more simple :

    SEARCH \b\d{4}\b OR \<\d{4}\>

    REPLACE 0$0

    Just use the $0 syntax, in replacement, which always represents the entire match. So, it avoids to add parentheses in order to store the match at group 1 :-)

    Cheers,

    guy038

  • 0 Votes
    1 Posts
    721 Views
    No one has replied
  • 1 Votes
    1 Posts
    1k Views
    No one has replied
  • Add more style token for highlighting

    Locked
    7
    0 Votes
    7 Posts
    15k Views
    chcgC

    Maybe you want to have a look at https://sourceforge.net/projects/analyseplugin/, also it helps you in logfile analysis just for a single file at a time.

  • 2 Votes
    13 Posts
    5k Views
    Mikhail VM

    @Scott-Sumner said:

    @Mikhail-V said:

    …read the current keyboard layout. This will require some WinAPI calls to the system. Probably it is possible, but I don’t know how to do it from Pythonscript.

    For purely educational purposes, here’s a way:

    import ctypes buff = ctypes.create_unicode_buffer(1024) ctypes.windll.user32.GetKeyboardLayoutNameW(buff) console.write(buff.value)

    This sort of works, but on windows 10 there is same issue as with AHK - it detects the layout
    only once when the application starts, but when I switch the layout and repeat the script -
    it returns same code value regardless of current layout.

  • Changing Font Size

    Locked
    4
    0 Votes
    4 Posts
    5k Views
    Scott SumnerS

    @Wynford-Junior-Thomas

    My font size has changed somehow

    Just theorizing on what might have happened: Perhaps you had the Ctrl key held down (accidentally) while you scrolled the mouse wheel? In case you didn’t know, this changes the “zoom” level that @Claudia-Frank mentioned…

  • 0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @George-Elam

    Settings->StyleConfigurator->Global Styles->Inactive tabs->change foreground color

    Cheers
    Claudia

  • Problem with some HTML files

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Pierre-Panissod

    do you have additional infos like where those files are stored,
    which npp version do you use (debug-info from ? menu)?
    Does it mean that two html files, saved in the same directory,
    behave different when on contains the line you mentioned
    but identical otherwise?

    Cheers
    Claudia