question

SuzanaEree-2102 avatar image
0 Votes"
SuzanaEree-2102 asked ·

Running Powershell through Notepad++ or SublimeText for using a better and complex Regex formulas

hello, I have a lot of regex formulas that works super in notepad++ or in sublime text. The problem us that PowerShell cannot run complex regex such as ^([\t ]*(\S+[\t ]+){1}\K(\S+), cannot read function like \K \G and also cannot make replacement such as ?1\U\1 or (?{1}\1)

PowerShell it is very limited in terms of regex.

So, to run more complex regex formulas, I wondered if it could somehow integrate notepad++/SublimeText or if it could somehow run regex via Notepad ++ or SublimeText.

Suppose I write a command in PowerShell that will connect Notepad++ or SublimeText, and through one of them to run the regex.

can be done something like that?

Because PowerShell is a very powerful program, and it cannot remain limited in terms of certain operations that work perfectly in other programs.

I, myself, cannot use PowerShell because cannot using much complex regex formula.

Someone that develops PowerShell can ask someone from Notepad++ or SublimeText to give a solution to integrate. Remember that: A very good program is one that can run any functions from other programs

maybe you can import some NPP https://sourceforge.net/projects/npp-plugins/files/

something can be done ! otherwise people will prefer another programs for regex. PowerShell would be much more powerful if it could integrate Notepad ++ or SublimeText functions.

windows-server-powershell
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

There are many different regex engines. They each have sequences that are unique to either themselves or to a group of them. For years I wrote code in Perl and found the PCRE engine to be excellent. Moving to the .Net regex engine was a letdown.

But using things such as "\K", which was created to avoid problems with regex engines that had problems with look-ahead, doesn't mean you need to use it.

I've never found any program that can run any function from other programs. And the same goes for regex engines, each of which have a language of their own!


0 Votes 0 ·

hello sir @RichMatheisen-8856 . It's about an option that can make PowerShell much better. This doesn't mean to change all the source code. But to have an option, like a plugin or something, or a command, that let user to use it by .net (notepad or sublimetext).

0 Votes 0 ·

You can use any regex engine you can put into a DLL. Instead of using the "regex" accelerator, you'd then use whatever name you compiled it into. E.g, instead of System.Text.RegularExpressions you might use PCRE.RegularExpressions. Just don't expect to use the PowerShell operators like "-match" and "-replace", or to have any of PowerShell's language to use your regex engine . . . although you might be able to do that if you compiled your DLL into the same ,Net class.

If you're using NotePad++ I think it's using the PCRE engine.

Comparison_of_regular-expression_engines



0 Votes 0 ·

0 Answers