• Is there a way to find words in one document that are not in the other?

    8
    0 Votes
    8 Posts
    4k Views
    guy038G

    Hi, @Lemmy-westin, and All,

    Thinking again about your problem, I succeeded to build a general method and the corresponding regexes !

    So, let’s suppose you have a text, separated in TWO parts, by a single line, build of some # characters.

    Then, you may like to search for :

    Case D1 : Lines, which lie, ONLY, in the FIRST part of the text ( BEFORE the ###### line )

    Case E1 : Lines, which lie, BOTH, in the TWO parts of the text ( BEFORE and AFTER the ###### line )

    Case D2 : Parts of line, which lie, ONLY, in the FIRST part of the text ( BEFORE the ###### line )

    Case E2 : Parts of line, which lie, BOTH, in the TWO parts of the text ( BEFORE and AFTER the ###### line )

    Case D3 : Single words, which lie, ONLY, in the FIRST part of the text ( BEFORE the ###### line )

    Case E3 : Single words, which lie, BOTH, in the TWO parts of the text ( BEFORE and AFTER the ###### line )

    Remark :

    If you want to search for ranges, in the SECOND part of text, exclusively, just swap the two parts of text and use, either, the case D1, D2 or D3 !

    To, correctly, define these three ranges of text, we’ll use a start boundary and an end boundary. They will be used, in the look-behind and look-ahead structures, and will NEVER be part of the regex to search for !

    For cases D1 and E1 :

    Start boundary = ^ ( Beginning of line ) OR \R ( End of Line characters of previous line )

    End boundary = \R ( End of line character(s) = \r\n in Windows files or \n in Unix files )

    Searched regex .+ ( All standard characters of any NO-blank line )

    For cases D2 and E2 :

    Start boundary = % ( An other dummy character, NOT already used in current text )

    End boundary = % ( The same character, as above )

    Searched regex = .+ ( Any NON-null range of standard characters, between the two % excluded limits )

    For cases D3 and E3 :

    Start boundary = \W ( A NON-word character, so, any character different from [0-9A-Za-z] and from all accentuated characters. This, also, includes the End of Line characters )

    End boundary = \W ( A NON-word character, as above )

    Searched regex = (\w+) ( A complete single word, of any length, between two excluded NON-word characters )

    Now, here are the regexes to achieve these different searches :

    Case D1 : (?i)^(.+)(?s)(?=\R.*#+(?!.*\R\1(\R|\z))) OR (?i)^(.+)(?s)(?=\R.*#+)(?!.*#+.*\R\1(\R|\z))

    Case E1 : (?i)^(.+)(?s)(?=\R.*#+(?=.*\R\1(\R|\z))) OR (?i)^(.+)(?s)(?=\R.*#+.*\R\1(\R|\z))

    You may test the D1 and E1 regexes with, for instance, the text, below, in a NEW tab :

    When we speak of free software, we are referring to freedom, not price. Our General When we speak of free software, we are referring to make sure that you have the freedom to distribute copies This is a simple test ######################################### This IS A simple TEST When we SPEAK of free freedom, not price. Our General make sure that you have the freedom, not price. Our General

    Case D2 : (?i)(?<=%)(.+)(?s)(?=%.*#+(?!.*%\1%)) OR (?i)(?<=%)(.+)(?s)(?=%.*#+)(?!%.*#+.*%\1%)

    Case E2 : (?i)(?<=%)(.+)(?s)(?=%.*#+(?=.*%\1%)) OR (?i)(?<=%)(.+)(?s)(?=%.*#+.*%\1%)

    You may test the D2 and E2 regexes with, for instance, the text, below, in a NEW tab :

    111 %When we speak of free% 111 222,%software, we are referring to%,222 333 % freedom, not price. Our General% 333 abc %When we speak of free% abc xyz,%software, we are referring to%,xyz %make sure that you have the% 555 %freedom to distribute copies% 555 666:%This is a simple test%:666 ##################################################################### 777|||%This is A simple TEST%|||777 888----%When we SPEAK of free%----888 999% freedom, not price. Our General%999 abc %make sure that you have the% abc 000000000% freedom, not price. Our General%0000000000000000 ------------- %make sure that you have the% ------------

    Case D3 : (?si)(?<=\W)(\w+)(?=\W.*#+(?!.*\W\1(\W|\z))) OR (?si)(?<=\W)(\w+)(?=\W.*#+)(?!.*#+.*\W\1(\W|\z))

    Case E3 : (?si)(?<=\W)(\w+)(?=\W.*#+(?=.*\W\1(\W|\z))) OR (?si)(?<=\W)(\w+)(?=\W.*#+.*\W\1(\W|\z))

    You may test the D3 and E3 regexes with, for instance, the text, below, in a NEW tab :

    software price freedom SOFtware prICE General Public This is a simple test to find out identical / different words inside that text ########################################################################################## This, is A test in order to know the same / different words of the text SoftwarE freeDOM genERal FREEDOM

    Notes :

    The last cases D3 and E3 are the ones, discussed in my previous topic

    All the regexes , above, are case insensitive. If searches must be sensitive, just change the (?i) syntaxes into (?-i) and the (?si) syntaxes into (?s-i)

    Remember that your text must contain just ONE line with , at least, one # character

    Regarding the D1, D2 and D3 equivalent regexes, their general template are :

    [Modifiers][Positive Look-Behind][Regex to Search][Positive Look-Ahead[Negative Look-Ahead]], with nested look-aheads

    [Modifiers][Positive Look-Behind][Regex to Search][Positive Look-Ahead][Negative Look-Ahead], with juxtaposed look-aheads

    Regarding the E1, E2 and E3 equivalent regexes, their general template are :

    [Modifiers][Positive Look-Behind][Regex to Search][Positive Look-Ahead[Positive Look-Ahead]], with nested look-aheads

    [Modifiers][Positive Look-Behind][Regex to Search][Positive Look-Ahead], with 1 look-ahead, only

    Just notice that a positive look-ahead, nested in an other positive look-ahead, may be merged in an unique look-ahead. But it’s impossible to merge a negative look-ahead, nested in a positive look-ahead !

    Of course, as usual, you may replace, delete, mark or bookmark the different matches, for further modifications !

    Cheers,

    guy038

  • Why we are made to use some other editor to edit npp macros?

    3
    0 Votes
    3 Posts
    2k Views
    PeterJonesP

    If that doesn’t work for you, you could copy shortcuts.xml to your desktop, edit that new copy, save, and exit Notepad++, then copy back from your desktop to the original directory (whether that’s your %AppData%\Notepad++\ or the same directory where notepad++.exe resides)

  • Remove spam from program's description

    3
    0 Votes
    3 Posts
    2k Views
    richluxR

    If it really bothers you, you can use a Windows resource editor such as Resource Hacker to edit the metadata of the Program. You’ll find the description in the Version Info section. Simply edit it, click Compile and then save it.

    Rich

  • w8, find/replace window is hidden below windows task bar

    1
    0 Votes
    1 Posts
    883 Views
    No one has replied
  • Reload text feature in Notepadd ++

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    MAPJe71M

    You can already use:

    the shortcut mapper to assign a key combination to the “Reload from disk” function; the Customize Toolbar plugin to add an icon to the toolbar.
  • Force closing file without update

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    Jim DaileyJ

    @Nikita-Sourine

    Exactly what one would expect if an external entity is “continuously” updating the file. In fact, the same thing should happen if you also click “Yes”!

    Once you have the service stopped, try looking into Settings->Preferences->Misc. If you uncheck Enable in the File Status Auto-Detection box, that might fix your issue (not entirely sure, plus I use an older program version and your UI may not match mine).

  • Loss of information after a failure

    Locked
    1
    0 Votes
    1 Posts
    842 Views
    No one has replied
  • Why does the "search backwards" feature was removed ???

    Locked
    3
    2 Votes
    3 Posts
    5k Views
    Vania WodeyV

    I also felt that last update was quite confusing.

    Here’s a screenshot-based explanation. Sorry for the French version, what matters is the position of the buttons in the Control-F menu, okay :)

    Link:
    http://i.imgur.com/sq6l1yh.jpg

  • Bug in version 7.4.2

    3
    0 Votes
    3 Posts
    2k Views
    Marc66M

    You’re right, thank you. It must have been re-enabled when I installed the latest version

  • Search, search and replace panel with files filter

    4
    0 Votes
    4 Posts
    2k Views
    los amigosL

    Find All in All Opened Documents and Replace All in All Opened Documents

    This is actually implemented and works fine, but I would like to be able to apply a filter to perform a search by a specific selection on files already opened, not by a directory as is already the case in the “find in files” tab.

    The only current option is equivalent to . , So I would like to have an opportunity to do a search only on a set of opened files such as " .ini; * .txt", by default an empty selection field would match ". *"

    I hope my explanation is understandable enough

  • [ViSimulator] 32 & 64bit version of ViSimulator plugin are uploaded

    5
    0 Votes
    5 Posts
    10k Views
    Adam BeutlerA

    The version posted above is much more limited than the old one. You can still find the old version via the web archive.

    https://web.archive.org/web/20150515145616/http://www.visimulator.com/download.html

  • [Feature Request] Hot key to insert the selection in the "Replace" field

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Linking .css file to you code

    3
    0 Votes
    3 Posts
    2k Views
    Claudia FrankC

    @Steven-Apell

    do you know https://www.w3schools.com/css/default.asp?
    They have a lot of good stuff about html coding.

    Cheers
    Claudia

  • Any plans to allow change of selected text foreground color?

    5
    0 Votes
    5 Posts
    3k Views
    richluxR

    You’re probably right, but I’m not happy with the workarounds for two reasons. First, they require 3rd party plugins. I’m trying to keep the footprint of NPP as small as possible and the plugins just add more bloat. Second, when using NPP across a large number of computers, the workaround has to be performed on every machine. I can’t just tell users to go into settings and change it to whatever they prefer. Unless there’s some underlying technical issue, It seems like an easy change to make since it’s already available in the Style Configurator, it’s just grayed out.

    Rich

  • Bug : Column mode edition Alt+C

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @Vince-kuzanagi

    I tried it on similar data with 2000 lines with no problem.

    Can you post your complete BEFORE and AFTER text (maybe on textuploader.com) that this problem happens with? [Make sure the problem happens with the XXX’s rather than just the real phone numbers…I’m sure you don’t want to post the real phone numbers…]

    Also try to describe exactly what you do: where is your caret before you start?, etc. Sometimes there is more to what you are doing than you say, and that can be the thing(s) that reveal a bug…

    Also, what version of Notepad++, including whether or not it is a 32 or 64 bit version.

  • [Feature Request] (Book)mark line above/below

    3
    0 Votes
    3 Posts
    2k Views
    Vertikcal HorizontalV

    What made me think about it was long registry files, where I wanted to delete differently named keys with similar values.

  • Join Lines function always create spaces

    2
    0 Votes
    2 Posts
    4k Views
    Scott SumnerS

    @zhangyuhangk

    Instead of using “Join Lines” you could do a regular expression replace-all operation:

    Find-what box: \R
    Replace-with box: make sure this box is EMPTY
    Search mode: ☑ Regular expression
    ☑ Wrap around (maybe…depending upon what you want…)
    “Join Lines” works on the active selection; if you want the replace operation to do likewise, then: ☑ In selection

    If this posting was useful, don’t post a “thanks”, just upvote ( click the ^ in the ^ 0 v area on the right )

  • [Feature Request] MIK encoding

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    No one has replied
  • `Ctrl + Q` failed to uncomment xml

    Locked
    1
    0 Votes
    1 Posts
    979 Views
    No one has replied
  • Read Only Files - Cannot Edit?

    Locked
    3
    0 Votes
    3 Posts
    3k Views
    Piotr TorteckiP

    The hosts file is the default attribute set R - and then in the Menu - Edit appears active option “Disable read only mode”