• 0 Votes
    25 Posts
    15k Views
    guy038G

    Hi Alan and MapJe71,

    Thanks, MapJe71, for the link about Word Boundaries, from the definitive site about regular expressions ! Of course, Alan, I know the differences between the three assertions : \b , \< and \>. I just preferred not to speak about it, first, in order to keep concentrated on your problem !

    To be short, the \b assertion acts, either, as a \< assertion OR as a \> assertion. This explains that the regex \<WORD\> can be simply replaced by the regex \bWORD\b.

    BTW, in the Words Boundaries table, I noticed the POSIX word boundaries ( [[:<:]] and [[:>:]] ) which have, exactly, the same meaning as the GNU word boundaries \< and >\ ). These syntaxes are functional, with the N++ Boost regex engine ! Unfortunately, Alan, the problem that you noticed does occur with the POSIX word boundaries, too :-((.

    On top of that, from the LAST row of the “Word Boundaries” table, named Word Boundaries behaviour, it is said that “word boundaries” are not correctly handled, in most regex engines :

    Word boundaries always match at the start of the match attempt if that position is followed by a word character, regardless of the character that precedes the start of the match attempt. (Thus, word boundaries are not handled correctly for the second and following match attempts in the same string.)

    And it shows an example :

    \b. matches all of the letters but not the space when iterating over all matches, in the string “abc def”

    So, I did some tests ( again !! )

    I copied this single sentence, below, part of the license.txt file, in a new tab By contrast, the GNU General Public License is intended to guarantee your freedom...

    In the Find dialog, I left the Match case and the . matches newline options UNCHECKED

    I selected, of course, the Regular expression search mode

    I tested the different regexes, below, against the example text

    REMARK : In the table, below, each dash character, under the sentence, indicates a match of the corresponding regex(es) !

    ======================================================================================================================== | REGEXES | EXAMPLE text - MATCHES noted by a DASH character | RESULTS | ======================================================================================================================== | | | | | | By contrast, the GNU General Public License is intended to guarantee your freedom... | INCORRECT ! | | (^|(?<!\w)). | ------------------------------------------------------------------------------------ | | | | | | +-----------------+--------------------------------------------------------------------------------------+-------------+ | | | | | \b. | | | | \<. | | | | [[:<:]]. | | | | | | | | | By contrast, the GNU General Public License is intended to guarantee your freedom... | INCORRECT ! | | \b\w | -- -------- --- --- ------- ------ ------- -- -------- -- --------- ---- ------- | | | \<\w | | | | [[:<:]]\w | | | | (^|(?<!\w))\w | | | | | | | +-----------------+--------------------------------------------------------------------------------------+-------------+ | | | | | | By contrast, the GNU General Public License is intended to guarantee your freedom... | INCORRECT | | (^|(?<=\W)). | - - - - - - - - - - - - - - | | | | | | +-----------------+--------------------------------------------------------------------------------------+-------------+ | | | (At last !) | | | By contrast, the GNU General Public License is intended to guarantee your freedom... | | | (^|(?<=\W))\w | - - - - - - - - - - - - - | CORRECT | | | | | ==================+======================================================================================+============== | | | | | | By contrast, the GNU General Public License is intended to guarantee your freedom... | INCORRECT ! | | .\b | -- - - -- -- -- -- -- -- -- -- -- -- - | | | | | | +-----------------+--------------------------------------------------------------------------------------+-------------+ | | | | | | | | | .((?=\W)|$) | By contrast, the GNU General Public License is intended to guarantee your freedom... | INCORRECT ! | | .((?!\w)|$) | - -- - - - - - - - - - - ---- | | | | | | | | | | +-----------------+--------------------------------------------------------------------------------------+-------------+ | | | | | .\> | | | | .[[:>:]] | | | | | | | | \w\b | By contrast, the GNU General Public License is intended to guarantee your freedom... | CORRECT | | \w\> | - - - - - - - - - - - - - | | | \w[[:>:]] | | | | \w((?=\W)|$) | | | | \w((?!\w)|$) | | | | | | | ========================================================================================================================

    From that table, it obvious that the handle of the assertions, by the N++ Boost engine, seems quite weird !!!

    To be coherent, only two regexes, with similar syntax, should be used :

    The regex (^|(?<=\W))\w, which matches the FIRST character of a word

    The regex \w((?=\W)|$), which matches the LAST character of a word

    => The regex (^|(?<=\W))\w|\w((?=\W)|$) matches the first AND the last characters of a word

    Best Regards,

    guy038

  • change.log always opens

    Locked
    3
    0 Votes
    3 Posts
    4k Views
    Willem de GrootW

    Yes, thanks!

  • 0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Andreas-R.

    is there a way to denote a keyword (for folding) that it should be considered only if it is the first word in a li

    afaik, no.
    What comes into my mind would be two ugly hacks.

    Assuming Visual FoxPro is case insensitive make it case sensitive and use
    different cases. Define the FOR loop keyword with an always to use variable
    like “FOR n” as the open folding part.

    Ugly, said it.

    Cheers
    Claudia

  • Is 7.31 Compatible With Win XP?

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    chcgC

    If https://github.com/gup4win/wingup/blob/master/vcproj/GUP.vcxproj is used, probably the updater is compatible with win xp. Would need a change of the toolset from v120 -> v120_xp.

  • Can't save files as HTML?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    dailD

    There is a bug with v7.3.1 that requires you type the file extension.

  • Is there an insert link function?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @William-DeFoore

    I believe you are going to have to define what you mean by “insert link”; otherwise I think that command is called “paste”. :-)

    Seriously, though, perhaps you don’t have this setting checked?
    Settings (menu) -> Preferences -> MISC. -> Clickable Link Settings -> Enable

    If you turn that “on”, when you create something that has the syntax of a hyperlink in your text, it should actually LOOK and ACT like a link.

  • Unable to Rename to a Mapped Network Drive

    3
    0 Votes
    3 Posts
    2k Views
    Veronica SutzerV

    All the mapped drives are present and accounted for and they are all connected.
    I can access them from explorer and move files manually to them.
    Only when using Rename can I no longer move them. I don’t receive any messages so it looks the same as it does when it worked only the file isn’t moved because it doesn’t work.

  • Can Notepad++ warn me when it is wrapping around to top of file?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Rick SilvaR

    Cool. It does flash. Thanks for the help!

  • User-Defined Language | Probleme coloration of a string in Group

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Corentin-Ambroise

    looks like udl does have a problem with the é.

    Cheers
    Claudia

  • RegEx for duplicate words (I'm not familiar withRegEx)

    3
    0 Votes
    3 Posts
    2k Views
    nafri brautN

    Thank you!

  • Close View from Compare 2.0

    Locked
    4
    0 Votes
    4 Posts
    7k Views
    pnedevP

    @Ed-Lipson ,
    I’ll need more info to be able to help you.
    What’s your version of N++? 64-bit or 32-bit?
    I’m not sure I understand this:

    I started it from the menu (was in 1.51, then upgraded the plugin to 2.00) Compare.

    You’ve had Compare plugin version 1.51?

  • Spell Check Fails to Install with Notepad++ update

    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Barry-Grossman

    Does that mean that you always install all plugins newly when npp updates?
    This shouldn’t be necessary.

    Is your post just to inform us that this is the case or do you still have an issue?

    Cheers
    Claudia

  • 2014 CVE Vulnerability

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    3 Posts
    3k Views
    Jim KricketJ

    Thank you so much Scott! That fixed my issue!

  • Replace function no longer replaces entire file

    4
    0 Votes
    4 Posts
    5k Views
    Dan WillinkD

    Brilliant! The Wrap around option is in my humble opinion a confusing term. I always understood it to be take away the blanks to the LEFT and RIGHT of the expression, not to the TOP and BOTTOM. But, am willing to adapt ;)

  • How do I Search: select\copy all matches?

    Locked
    4
    0 Votes
    4 Posts
    12k Views
    Scott SumnerS

    @Nick-L

    I don’t think you read the other thread closely enough. In there is a Pythonscript method (by me) for copying only redmarked text, as well as a regular-expression method for producing only the matched text from a regex search in a document. The regex method is destructive, so if you need the original text, I suggest you make a backup copy first.

    I would forget the “negated regex” method…blech! :-)

  • <% %> synrax in html file

    6
    0 Votes
    6 Posts
    3k Views
    slim1979S

    @Claudia-Frank
    thanks!
    you’re right, i was mistaken, its not no-readable, its hard-readable text.
    now its much better!

  • Using Python with Notepad++

    6
    0 Votes
    6 Posts
    41k Views
    chemebabakC

    Claudia, thanks for this:

    N++ is better than Python idle because each line of code in N++ is numbered, whereas idle in not. That makes it difficult to troubleshoot a file with 1000 lines of code.

    Great, I did not know about that plug-in.

    A lot of people use lmddgfy sarcastically, but that link you sent me helped me a lot because I am not familiar enough with idle to determine the keywords for a ddg search.

    Thanks!

  • Regex: DateTime

    Locked
    6
    0 Votes
    6 Posts
    5k Views
    MAPJe71M

    @Vasile-Caraus

    I second @Alan-Kilborn 's remarks, IMO you should no longer be considered a beginner. After the amount of questions you posted related to regular expressions and the answers you got based on goodwill of other community member(s) (i.e. @guy038), you’ve had plenty of time to learn the basics.

    There are lots of sites available for regular expression related questions specifically, to name some:

    Learn regular expressions the hard way Regular Expressions 101 Regular-Expressions.info (by RegexBuddy author/developer).

    Furthermore, one doesn’t have to be a programmer to learn and use regular expressions.

  • EOL Conversion file size limit?

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied