Community
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • All categories
    • B

      Code is not working

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      3
      0 Votes
      3 Posts
      31 Views
      CoisesC
      @PeterJones said: It’s not ideal, but without some magical regex manipulation to make it less backtracky (hints in the complexity section), you’re not likely to find a regex that doesn’t become invalid for you. @blake-g.-barrington , @PeterJones: I can’t say for certain — much of Boost.regex (the regular expression engine Notepad++ uses) is still a black box to me — but I think it’s unlikely that any regex can do what is requested without getting the complexity error on large files. As best I can tell, Boost.regex is a bit “trigger happy” with that warning. It doesn’t really know whether the expression is trapped in a loop that isn’t progressing, it just knows that it seems to be scanning the same text over and over again. For any regex to solve this problem, it has to scan the same text over and over: for every line, it needs to check every following line up to the end of the file, unless it finds a match sooner. Given that and what I have observed about Boost.regex, I would not recommend spending a lot of time trying to improve the regular expression. As @PeterJones noted, if you don’t need to preserve the order of lines in the files, the solution is simple: sort the file first. If you do need to preserve order, the next question is whether this is a one-time thing you need to do to solve a specific problem, or a recurring task you’ll need to perform against various files in the future. If it’s a recurring task, ditch the regular expressions and write a script. Python is probably the best language for scripting in Notepad++, but I’m not very familiar with Python, so I’ll leave it to someone else to explain that approach if that is what you need. If this is a one time thing, then I would suggest: Insert line numbers at the beginning of each line. Make a zero-width rectangular selection following the line numbers and sort. Adapt your regular expression to find adjacent lines that contain duplicate text following the line number and make a replace expression that adds a marker character following the line number: a character that isn’t used otherwise in the file. Sort on the line numbers to put things back in order. Mark lines that contain the marker character. Use Replace All to delete the marker character.
    • Carlos SánchezC

      [New plugin] Smart Math

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      4
      1 Votes
      4 Posts
      711 Views
      Vitalii DovganV
      A small example of what is already working: [image: 1788632411234-cf4e0aa7-d7a1-4c9c-a14f-db8fb19ae2a3-image.jpeg] This demonstrates just several functions; the other functions from USAGE_AND_SYNTAX work as well. The next step is to: Create a syntax file to apply “function color” to built-in functions; Apply this syntax file automatically when Smart Math is enabled for the current file/document. The syntax file can be created by means of user-defined language. But how to apply this user-defined language automatically when Smart Math is enabled for the current file/document?
    • cosmic-hyenaC

      adverts on download page?

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      6
      0 Votes
      6 Posts
      335 Views
      cosmic-hyenaC
      @PeterJones I sent him an email but got no reply. Overall I’m a bit disappointed with this. I think for all his good intentions he’s allowing a strong chance of people accidentally clicking on these malware links, Got nothing more to add. Thanks.