Better RegEx Support

Features wanted...
Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Better RegEx Support

Post by Mesh » 12 May 2008 09:47

I love that XY supports RegEx. However, it does so through VBScript, which is somewhat limited. It would be nice if XY supported a more robust flavor, such as Perl RegEx.

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Better RegEx Support

Post by admin » 12 May 2008 11:54

I'm not aware of a way to do this.

For RegEx XY uses this file C:\WINDOWS\system32\vbscript.dll, which can be expected to be present in virtually every Windows system nowadays.

Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Re: Better RegEx Support

Post by Mesh » 12 May 2008 15:06

admin wrote:
I'm not aware of a way to do this.

For RegEx XY uses this file C:\WINDOWS\system32\vbscript.dll, which can be expected to be present in virtually every Windows system nowadays.

Well, I don't know what language you program XY in - I'm assuming it's not Perl. :)

In that case, however, one good possibility is to use PCRE (Perl Compatible Regular Expressions), which is an open source library written in C (although many people have made libraries from PCRE to make it compatible with other programming languages). That makes it easy and free to implement, in most cases.


There's more information about it here, if you're interested:

http://www.regular-expressions.info/pcre.html
http://en.wikipedia.org/wiki/PCRE
http://www.pcre.org/

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Better RegEx Support

Post by admin » 12 May 2008 20:28

Mesh wrote:
admin wrote:
I'm not aware of a way to do this.

For RegEx XY uses this file C:\WINDOWS\system32\vbscript.dll, which can be expected to be present in virtually every Windows system nowadays.

Well, I don't know what language you program XY in - I'm assuming it's not Perl. :)

In that case, however, one good possibility is to use PCRE (Perl Compatible Regular Expressions), which is an open source library written in C (although many people have made libraries from PCRE to make it compatible with other programming languages). That makes it easy and free to implement, in most cases.


There's more information about it here, if you're interested:

http://www.regular-expressions.info/pcre.html
http://en.wikipedia.org/wiki/PCRE
http://www.pcre.org/
The language is VB. Even if PCRE would work with VB (which I never heard of), I wouldn't use it because I would not like to ship a 3rd party component. So thanks, but no. :)

Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Re: Better RegEx Support

Post by Mesh » 12 May 2008 20:50

admin wrote:
The language is VB. Even if PCRE would work with VB (which I never heard of), I wouldn't use it because I would not like to ship a 3rd party component. So thanks, but no. :)

I understand (although vbscript.dll is technically a 3rd party component as well). :)

Although I personally despise managed languages, if you're using VB.net instead of VB anyway, you'd also have access to the .NET RegEx libraries. (But if you're not using the .NET version, please don't switch!)


In any case, I'll just put this out there as an idle wish. :)

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Better RegEx Support

Post by admin » 12 May 2008 20:53

Mesh wrote:
admin wrote:
The language is VB. Even if PCRE would work with VB (which I never heard of), I wouldn't use it because I would not like to ship a 3rd party component. So thanks, but no. :)

I understand (although vbscript.dll is technically a 3rd party component as well). :)

Although I personally despise managed languages, if you're using VB.net instead of VB anyway, you'd also have access to the .NET RegEx libraries. (But if you're not using the .NET version, please don't switch!)


In any case, I'll just put this out there as an idle wish. :)
I use VB6. (And I'm proud! :wink: )

Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Re: Better RegEx Support

Post by Mesh » 12 May 2008 21:12

admin wrote:
I use VB6. (And I'm proud! :wink: )

Good man!

jackpots
Posts: 11
Joined: 23 Oct 2012 17:14

Re: Better RegEx Support

Post by jackpots » 01 Apr 2015 18:23

I think it is time to re-evaluate the sentiment to move to a more feature-rich implementation of Regular Expression, and PCRE2 is probably the best way to go. VB uses the JavaScript implementation in Internet Explorer 5.5, and that's at the turn of the century (1999/2000). Time to move on. Right?

Since PCRE is more robust, it could replace all the current items in the Replace menu, except for the incrementing number. More importantly, it would afford the users much greater abilities in searching, and in string replacements. The current Regex is decent but limited. For example, one cannot manage the case of a replaced capture.

In addition, PCRE is open and BSD licensed.

PCRE= Perl Compatible Regular Expression

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: Better RegEx Support

Post by Papoulka » 02 Apr 2015 00:53

PCRE will support negative lookbehind, which is essential for finding stuff not preceded by other stuff. It would be nice to have.

Marco
Posts: 2266
Joined: 27 Jun 2011 15:20

Re: Better RegEx Support

Post by Marco » 02 Apr 2015 12:12

+1

I even thought about writing some XY scripts to offload regex matching to external utilities like http://www.rexegg.com/pcregrep-pcretest.html or https://sites.google.com/site/regexreplace/ , but I have no time and I'm not a fan of using temp files for these kind of things.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

aliteralmind
Posts: 255
Joined: 02 Dec 2014 16:49

Re: Better RegEx Support

Post by aliteralmind » 03 Apr 2015 14:37

+1 as well.

Don't know if this is compatible, but TextPad uses the Boost regex engine, which has some lookbehind issues, but is otherwise an excellent PCRE-like engine.
Windows 8.1, 64-bit

Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Re: Better RegEx Support

Post by Mesh » 03 Apr 2015 14:47

I would love moving to PCRE. The Javascript flavor of RegEx is limited in some unfortunate ways.

SammaySarkar
Posts: 4205
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Better RegEx Support

Post by SammaySarkar » 03 Apr 2015 15:10

admin wrote:Even if PCRE would work with VB (which I never heard of), I wouldn't use it because I would not like to ship a 3rd party component. So thanks, but no. :)
Could provide an option in config: Regular Expression handlers, like custom copy handlers. :)

Mesh
Posts: 934
Joined: 24 Mar 2008 21:22

Re: Better RegEx Support

Post by Mesh » 03 Apr 2015 15:19

SammaySarkar wrote:
Could provide an option in config: Regular Expression handlers, like custom copy handlers. :)

Oooo, that sounds lovely. If that's done, there should be a link on the site for a trusted package that works with this feature out of the box.

Marco
Posts: 2266
Joined: 27 Jun 2011 15:20

Re: Better RegEx Support

Post by Marco » 21 Apr 2015 16:05

SammaySarkar wrote:Could provide an option in config: Regular Expression handlers, like custom copy handlers. :)
I love this idea. If it proves to be possible and doable, then we could write a petition to the "Regex Guy" (Jan Goyvaerts - http://www.just-great-software.com/ ) and ask him to write an external regex module hookable into XY. I'd gladly pay for that.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply