Function list regex debugging
-
@PeterJones Yeah, I did, but I didn’t assume it would be what I’m looking for. In hindsight I absolutely should have looked there. Maybe this section could hint the library and version is on the other page, but I do see this as an user error, so not sure 😅
-
@sdasda7777 said in Function list regex debugging:
I’m looking for the sort of debugger that regex101 has, where you can step through the execution to see where exactly it goes wrong
Commercial: RegexBuddy can debug Boost regexes.
-
@sdasda7777 said in Function list regex debugging:
@PeterJones Yeah, I did, but I didn’t assume it would be what I’m looking for. In hindsight I absolutely should have looked there. Maybe this section could hint the library and version is on the other page,
I had hoped that “… syntax spelled out in the docs on Searching: Regular Expressions” would be enough of a hint. Apparently not.
Possible new paragraph in the Notes on regular expressions for parsers section:
Because the Function List parser uses a subset of the same regular expression syntax that Notepad++ uses for Search > Find regular expressions, you can use Notepad++'s search dialog with Search Mode set to ☑ Regular Expression to experiment with the searches. (If you choose to use some other tool – like one of the many web-based regex explainers – to help you debug your expression for your Function List definition, please understand that there are many implementations of regular expressions, and even very similar implementations have subtle differences in behavior. You would need to find a tool that uses the exact same Boost library version that Notepad++ uses to have their results be identical. The Searching: Regular Expressions section should always list the version of the Boost library used by the most recent Notepad++, and will be updated if Notepad++ ever moves from Boost to some other regular expression library.) Because you aren’t the first to be confused by those tools, either for Function List parsers or Notepad++ searching in general, I am also thinking of updating the first paragraph of the Searching: Regular Expressions to be:
Notepad++ regular expressions (“regex”) use the Boost regular expression library v1.80 (as of NPP v8.4.7), which is based on an old PCRE (Perl Compatible Regular Expression) syntax, only departing from it in very minor ways. Complete documentation on the precise implementation is to be found on the Boost pages for search syntax and replacement syntax. (Some users have misunderstood this paragraph to mean that they can use one of the regex-explainer websites that accepts PCRE and expect anything that works there to also work in Notepad++; this is not accurate. There are many different “PCRE” implimentations, and Boost itself no longer claims to be “PCRE”, though both Boost and PCRE variants have the same origins in an early version of Perl’s regex engine. If your regex-explainer does not claim to use the same Boost engine as Notepad++ uses, there will be differences between the results from your chosen website and the results that Notepad++ gives.) Let me know if you think that clarifies things more
-
Commercial: RegexBuddy can debug Boost regexes.
Interesting, thanks for bringing it to attention! 😄 But it’s €40, which I assume most people aren’t willing to spend on a tool they expect to use once 😕
-
I was thinking more along the lines of visualizing what is found and in case of an invalid regex seeing the information why it failed but … that can’t replace a regex debugger, surely not.
-
@sdasda7777 brings good questions which I’ll rephrase as
How do the developers and maintainers of function list definitions do it? What tools are they using?
-
RegexBuddy
-
@sdasda7777 said in Function list regex debugging:
which I assume most people aren’t willing to spend on a tool they expect to use once
Well, I bought it based upon someone else’s advice here, and I use it all the time, not just for Notepad++ purposes. To me it was money well spent. Each has to judge for himself.
-
@Alan-Kilborn Of course. As I said, I really do appreciate that you suggested it, because I have no doubt for someone who knows they will be sticking around it will be an easy choice.
-
@Alan-Kilborn ,
Thanks @Alan-Kilborn , for bringing that option up, as I forgot to mention that, since I bought them myself, too, but after my initial trials and tribulations with Regex. I actually bought both, Regex Buddy and Regex Magic.However, it just became easier to use the Regex101 for quick dirty checks on my small code chores, as there is so many options and such in those programs, that at the time, it was like learning 3 sets of the Encyclopedia, one for NPP, one for Regex, and one for the Regex Buddy/Magic options. Was going dizzy back then, as I remember mentioning. :-)
However, since then, I have used those tools more, using the search box inside NPP itself along with Mark, etc, but also still on occasion use the Regex101 site, since i have the link in the same menu area as the Notepad++ links, so it’s quick and easy. :)
So there is one more tool for him to get what he needs to learn provided, he’s seriously interested. :-)
-
@Lycan-Thrope said in Function list regex debugging:
but also still on occasion use the Regex101 site, since i have the link in the same menu area as the Notepad++ links, so it’s quick and easy
I have my Run menu set up with a command to “Launch RegexBuddy”, thus making it as simple as what you’re saying that you have for regex101.
RegexBuddy has a lot of options because it is very powerful. It’s always a struggle between simplicity and power, where a UI design is concerned – just consider Notepad++ itself.
But we’ve probably strayed off-topic too much with talk of RegexBuddy.
The important point I wanted to make was that people continually use regex101 and then, for more complex expressions, complain that Notepad++ isn’t acting the same way…and the reason for that is that they use different engines and neither one is wrong (but there is only something wrong when you compare different results obtained).