Better RegEx Support
Better RegEx Support
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.
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Better RegEx Support
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.
For RegEx XY uses this file C:\WINDOWS\system32\vbscript.dll, which can be expected to be present in virtually every Windows system nowadays.
FAQ | XY News RSS | XY Twitter
Re: Better RegEx Support
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/
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Better RegEx Support
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 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/
FAQ | XY News RSS | XY Twitter
Re: Better RegEx Support
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.
-
- Site Admin
- Posts: 60558
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Better RegEx Support
I use VB6. (And I'm proud! )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.
FAQ | XY News RSS | XY Twitter
Re: Better RegEx Support
admin wrote:
I use VB6. (And I'm proud! )
Good man!
Re: Better RegEx Support
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
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
Re: Better RegEx Support
PCRE will support negative lookbehind, which is essential for finding stuff not preceded by other stuff. It would be nice to have.
Re: Better RegEx Support
+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.
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]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
- Posts: 261
- Joined: 02 Dec 2014 16:49
Re: Better RegEx Support
+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.
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
Re: Better RegEx Support
I would love moving to PCRE. The Javascript flavor of RegEx is limited in some unfortunate ways.
Re: Better RegEx Support
Could provide an option in config: Regular Expression handlers, like custom copy handlers.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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Better RegEx Support
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.
Re: Better RegEx Support
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.SammaySarkar wrote:Could provide an option in config: Regular Expression handlers, like custom copy handlers.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]