• help for quotes please

    Jul 8, 2022, 4:27 AM
    0 Votes
    4 Posts
    267 Views

    Hello, @bastien-allouard, @peterjones and All,

    I’ve got a solution which needs the installation of the excellent BetterMultiSelection plugin, from @dail ! So :

    Open the menu option Plugins > Plugins Admin...

    Select the BetterMultiSelection plugin

    Click on the Install button

    Click on the Close button

    For security, close and restart Notepad++

    Now, assuming that you have this INPUT text :

    Hyping "Hyping" Fulfillingcontract "Fulfilling contract" Time-limit "Time-limit" Requiredquality "Required quality" Upfront "Upfront" Whendone "When done" Penalty "Penalty" Costperbug "Cost per bug" Bugpenalty "Bug penalty" Latepenalty "Late penalty" Qualitypenalty "Quality penalty" Cancelpenalty "Cancel penalty" Netprofit "Net profit" Delivered "Delivered" Maxbandwidth "Max bandwidth" Lookagain "Look again" LookAgainPrompt "Are you sure you want to look again? It will cost {0}" Hyping "Popularité" Fulfillingcontract "Contrat rempli" Time-limit "Limite de temps" Requiredquality "Qualité requise" Upfront "Avance" Whendone "A la livraison" Penalty "Penalté" Costperbug "Coût par bug" Bugpenalty "Pénalité des bugs" Latepenalty "Pénalité de retard" Qualitypenalty "Pénalité de Qualité" Cancelpenalty "Pénalité d'annulation" Netprofit "Profit net" Delivered "Livré" Maxbandwidth "Bande passante Max" Lookagain "Actualiser" LookAgainPrompt "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"

    First, let’s change any tab char by the corresponding space chars with the menu option Edit > Blank Operations > TAB to Space

    Select all the lines, English and French

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?-s)^(\h*).+?"

    REPLACE \1"

    Tick the Wrap around and In selection options

    Select the Regular expression search mode

    Click on the Replace All button

    You should obtain the OUTPUT text below :

    "Hyping" "Fulfilling contract" "Time-limit" "Required quality" "Upfront" "When done" "Penalty" "Cost per bug" "Bug penalty" "Late penalty" "Quality penalty" "Cancel penalty" "Net profit" "Delivered" "Max bandwidth" "Look again" "Are you sure you want to look again? It will cost {0}" "Popularité" "Contrat rempli" "Limite de temps" "Qualité requise" "Avance" "A la livraison" "Penalté" "Coût par bug" "Pénalité des bugs" "Pénalité de retard" "Pénalité de Qualité" "Pénalité d'annulation" "Profit net" "Livré" "Bande passante Max" "Actualiser" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"

    Enable, if necessary, the BetterMultiSelection plugin

    Do a zero-length rectangular selection of all the lines ( Hit, simultaneously the Alt and Shift keys and press the Down key, several times )

    Release all the keys, then hit the End ( or Fin ) key

    => All the cursors should be at the end of lines

    Hit the Enter key to insert blank lines, in between

    Hit the Backspace key to delete the tabulations ( IMPORTANT )

    Hit the Esc key to disable your rectangular selection

    You’ll get this OUTPUT :

    "Hyping" "Fulfilling contract" "Time-limit" "Required quality" "Upfront" "When done" "Penalty" "Cost per bug" "Bug penalty" "Late penalty" "Quality penalty" "Cancel penalty" "Net profit" "Delivered" "Max bandwidth" "Look again" "Are you sure you want to look again? It will cost {0}" "Popularité" "Contrat rempli" "Limite de temps" "Qualité requise" "Avance" "A la livraison" "Penalté" "Coût par bug" "Pénalité des bugs" "Pénalité de retard" "Pénalité de Qualité" "Pénalité d'annulation" "Profit net" "Livré" "Bande passante Max" "Actualiser" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"

    Now, redo a zero lengh rectangular selection of the french lines only, including the blank ones

    While keeping pressed the Alt and Shift keys, hit the End ( or Fin ) key to include all text

    Press the Ctrl + X shortcut, to move that text in the clipboard

    Hit the Esc key to disable the rectangular selection

    Now, move the caret at the very beginning of the first blank line, under the line "Hyping"

    Hit the Ctrl + V shortcut

    => Wow ! you should get this OUTPUT text, below :

    "Hyping" "Popularité" "Fulfilling contract" "Contrat rempli" "Time-limit" "Limite de temps" "Required quality" "Qualité requise" "Upfront" "Avance" "When done" "A la livraison" "Penalty" "Penalté" "Cost per bug" "Coût par bug" "Bug penalty" "Pénalité des bugs" "Late penalty" "Pénalité de retard" "Quality penalty" "Pénalité de Qualité" "Cancel penalty" "Pénalité d'annulation" "Net profit" "Profit net" "Delivered" "Livré" "Max bandwidth" "Bande passante Max" "Look again" "Actualiser" "Are you sure you want to look again? It will cost {0}" "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"

    Finally, do the last regex S/R, below :

    SEARCH (?-s)^(\h*)"(.+)"\R\h*(.+)

    REPLACE \1\2\x20\3

    This regex selects two lines and rewrites all chars of the first line, but the double quote chars. Then, changes the EOL, between the two lines, with a space char and, finally, rewrites the contents of the second line

    So, you should get your expected OUTPUT text :

    Hyping "Popularité" Fulfilling contract "Contrat rempli" Time-limit "Limite de temps" Required quality "Qualité requise" Upfront "Avance" When done "A la livraison" Penalty "Penalté" Cost per bug "Coût par bug" Bug penalty "Pénalité des bugs" Late penalty "Pénalité de retard" Quality penalty "Pénalité de Qualité" Cancel penalty "Pénalité d'annulation" Net profit "Profit net" Delivered "Livré" Max bandwidth "Bande passante Max" Look again "Actualiser" Are you sure you want to look again? It will cost {0} "Êtes-vous sûr de vouloir actualiser ? Cela vous coûtera {0}"

    Best Regards,

    guy038

  • Copy and paste between two files

    Jul 8, 2022, 9:52 PM
    0 Votes
    7 Posts
    2k Views

    @PeterJones
    OK, I’ll try it. Thank you.

  • Ersetzen mit Wildcard, wie?

    Jul 9, 2022, 2:22 PM
    0 Votes
    3 Posts
    2k Views

    @Bernd-Gebhardt

    Maybe try:

    Find: width=“800” hight=“\d{3,4}” border=“0”
    Replace: width=“80%” border=“0”
    Search mode: Regular expression

    Note: Because you didn’t follow the RULES for posting such a question, I don’t know what “kind” of double-quotes you have, so you may have to adjust that.

  • 0 Votes
    19 Posts
    2k Views

    @Ekopalypse Yes, this version seems to work fine! Many thanks!

  • Associate or open workspace files

    Jul 5, 2022, 10:38 AM
    0 Votes
    4 Posts
    1k Views

    Thanks guys, will look into this config.xml file format more.

  • 0 Votes
    10 Posts
    711 Views

    @PeterJones

    OK, did as you suggested but that was a no go. Enabling or disabling Direct Write did not made a difference.

    Anyway, thanks 4 you suggestion…

  • 0 Votes
    9 Posts
    2k Views

    Wow, HxD is exactly the tool for hex files comparison I needed, thanks much!

    François

  • 0 Votes
    3 Posts
    2k Views

    @PeterJones

    Thank you!!! It works. I have been wondering that for many months now. I appreciate your help.

  • 0 Votes
    4 Posts
    2k Views

    @Mike-Tyson said in VDHL Block comment adding incorrect delimiter:

    should, as OP is suggesting, revert to block-commenting with “–” on every line, as this is backward compatible

    I maintain that it is already configurable, and my post from a year ago already explained how to configure it. If this is not sufficient for your needs, you are free to put in a feature request (as explained in this FAQ), as we can do nothing about changing the codebase in this Community of fellow users of Notepad++

  • 0 Votes
    7 Posts
    4k Views

    The feature @Rayhaan-Sahib mentions was added in 8.0 with THIS change.

    As 8.0 was released on 2021-06-07, the discussion earlier in this thread predates that.

  • Keep only last word of each line

    Jul 6, 2022, 10:05 AM
    0 Votes
    2 Posts
    715 Views

    @Vinc-Cser

    Find: (?-s)^.*?(\w+)$
    Replace: ${1}
    Search mode: Regular expression

  • 0 Votes
    2 Posts
    334 Views

    @Scotty-Fitz ,

    You are correct. The codebase that Notepad++ uses for syntax highlighting HTML and related languages applies the same styling to all attributes, so it doesn’t treat the class attribute differently.

    There is an “EnhanceAnyLexer” plugin which can be installed from the Plugins Admin, and it will allow you to define a regex which will look for class="..." and style that text differently than other attributes.

  • 1 Votes
    4 Posts
    356 Views

    @gibberishbc

    This is indeed an older thread, your recent threads are others.

    As for the fake return statement, assuming a language doesn’t have start and end tokens like if and endif but does have comments, which is the case in most programming languages, you could use the start token if and a end token like #endif, where # is actually a comment.
    This way, the language itself is still happy when it is executed, and npp (or UDL) knows where to break.

  • 0 Votes
    4 Posts
    316 Views

    @Sibusiso-Dlomo

    So, before text is:

    line 1 line 2 line 3 Name Catch me line 5 Slogan If You Can line 7

    and after text is:

    line 1 line 2 line 3 Name Catch me If You Can line 5 Slogan If You Can line 7

    You could do:

    Find: \A(?-is)(?:.*\R){3}.*\K(?=\R(?:.*\RSlogan(.+)))
    Replace: ${1}
    Search mode: Regular expression

    Other solutions are definitely possible.

  • 0 Votes
    3 Posts
    409 Views

    Thank you for your direct responce.
    It works great.

    Its perfect

    Thank you again
    Evangelos

  • Find/Replace Regex?

    Jul 4, 2022, 7:02 AM
    0 Votes
    4 Posts
    1k Views

    @Jörg-Winkel said in Find/Replace Regex?:

    It does, however, do exactly what I need today, so thanks a lot for your help.

    I thought I might follow up with some more information as I don’t think you realise how powerful/loose the use of the \D actually is. This post is also for others hoping to learn something.

    \D means “not a digit” which sounds okay until you consider that it really means ANY character that isn’t a digit. So alpha’s are certainly part of that group as the OP wanted. However it also includes punctuation characters such as ;:"',.? and if you see my image, it will include line feed and/or carriage return characters. So ANY character except for the 10 digit ones.
    7c8348e5-542c-4197-b295-b2999b988889-image.png
    The example in the image is admittedly made up on purpose to highlight the power of the \D but it shows how a regular expression (regex) can select other strings in error if one isn’t aware of what it means. Also note that I included a 3 non-digit plus 7 digit string in the example. Again the regex selected the portion it was required to find, that of the 6 digits following the 3 non-digit string. So the 7th digit was excluded. This means upon editing the string we finish up with ;#AB234567;8. I would say that’s a definite error. If only 6 digit strings were to be selected, a test at the end of the find expression would look for 1 or more digits and based on the criteria, either exclude that string or include all of it.

    I’d say this is a prime example of a loosely made expression very likely to have unwarranted side effects.

    Those who do create regexes for others take this into account and is often what we spend more time on, the “edge cases”. Edge cases can be likened to programming where 20% of the code does the work and 80% of the code is error checking. The percentages do vary according to who you talk to but the sentiment still exists across the programming world.

    Terry

  • Document List vs NP++ sessions

    Jul 4, 2022, 6:26 PM
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • 0 Votes
    7 Posts
    590 Views

    @PeterJones
    Good catch - thanks!

  • Text Case Formatting

    Jul 2, 2022, 2:57 PM
    0 Votes
    4 Posts
    290 Views

    @Alan-Kilborn said in Text Case Formatting:

    @Mark-Kani

    Take your pick of case-change options:

    1f961d62-bb01-4e86-8c47-eda942d1bab9-image.png

    Don’t be surprised if none of them 100% ever meet your exact need (for your data).

    If you are addicted to the right-click way of doing it, you can customize that menu to add the ones you use most; read about how to do that HERE.

    @Alan-Kilborn said in Text Case Formatting:

    @Mark-Kani

    Take your pick of case-change options:

    1f961d62-bb01-4e86-8c47-eda942d1bab9-image.png

    Don’t be surprised if none of them 100% ever meet your exact need (for your data).

    If you are addicted to the right-click way of doing it, you can customize that menu to add the ones you use most; read about how to do that HERE.

    that is really useful information which you shared , i was also facing the same problem, thanks mate!!!

  • UDL trigger modifiers

    Jul 3, 2022, 11:56 PM
    0 Votes
    2 Posts
    242 Views

    @gibberishbc

    the official documentation is here and no, a ^ does not mean it has to be the beginning of a line. If you think this has to do with regex, then no, UDL doesn’t support regex yet.

    The ultimate truth is in the source.