|
is this the standard you implemented your regex engine?
diligent hands rule....
|
|
|
|
|
It's implemented in FastFA which I linked you to in the comments of the one you were on.
It's best to use FastFA rather than the regex engine i wrote that you were looking at.
FastFA is faster, more complete, and supports unicode.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
|
You can't use my engine for that. Those are backtracking constructs.
You can use .NET's engine. It's slower, but backtracks.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
do you mean ".NET engine" is the one built in C#?
diligent hands rule....
|
|
|
|
|
Technically it's built into .NET, not C#, but yes you can use it from C#. It's the one you're thinking of.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
No. POSIX has some specifications, but there's no guarantee all flavors will care about POSIX compliance. Also, there's basic and extended matching, which adds another layer of blah. However, PCRE is so popular that that's also a good one to adhere to. Even JS should be ok 99% of the time if you learn PCRE. But, keep in mind there's also PCRE1 and PCRE2, so referring to PCRE1 in particular, but you should know both.
Couple of sites to always use to help with the learning curve:
Regular Expressions Reference Table of Contents
regex101: build, test, and debug regex
Regex 101 is awesome, it'll allow you to choose the flavor/engine you're working with, out of the most popular ones.
In short, learn PCRE 1 and 2. That'll take you the furthest and a lot of engines just copied off that one anyway.
Jeremy Falcon
|
|
|
|
|
diligent hands rule....
|
|
|
|
|
Stored with the Lost Ark probably.
I use the implementation in .net, which means knowing not only the Regular Expression syntax, but the classes which use them as well.
modified 5-Oct-23 11:06am.
|
|
|
|
|
Official is no help if you're using an unofficial engine.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Just noting that java, C# and javascript all use a subset of the Perl regex.
I think at least one of the other languages (python, ruby) also uses that.
The Dragon Book ("Compilers Principles, Techniques and Tools") defines a very limited regular expression language which is then used throughout the book.
|
|
|
|
|
diligent hands rule....
|
|
|
|
|
Whichever engine you are using, if you are doing fairly complicated regex expressions…
Create a lot of positive and negative test cases for your uses. That way if you ever port it or upgrade the regex engine, you will know it is still working.
I upgraded one toolset on Windows that totally changed how it handled \r\n line termination between versions. I wrote all of my test cases once I realized the mess that update created.
|
|
|
|
|
thanks for great tips
diligent hands rule....
|
|
|
|
|
I am kicking off a new application that will allow the local SQA and Engineering departments to test a new product. Part of this is to ponder some new ideas - add a database to save test results, etc. I'm also considering embedding python into the application such that the tests would be driven by script rather than some embedded file format. But, this is a new area for me, so can anyonw point out real life examples where this ability was useful?
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
I am kicking off a new application that will allow the local SQA and Engineering departments to test a new product. Part of this is to ponder some new ideas - add a database to save test results, etc. I'm also considering embedding python into the application such that the tests would be driven by script rather than some embedded file format. But, this is a new area for me, so can anyonw point out real life examples where this ability was useful?
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: But, this is a new area for me, so can anyonw point out real life examples where this ability was useful? Forget Python and use Lua . Lua was 100% created for this and you don't have to worry about security issues as much out of the box.
Jeremy Falcon
|
|
|
|
|
I'll look into it. Thanks.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Oh, to actually answer your question that I quoted as far as usefulness. Having macros in an application can be very useful, just depends on the app and use case. Photoshop has actions, which is the same thing and some photographers couldn't live w/o it. Granted, it's not code based but most hardcore Photoshop users aren't coders.
As far as the usefulness of having testing type scripts/macros, guess it would depend on the end user and the use case of what's being automated. If you're using Lua, for instance, you can 100% tie that into controlling the UI of your app, just like Photoshop does with their actions.
If the end users are engineers, it could be very useful. I do web development these days, but having test and code coverage is something that no dev should forget for an enterprise application.
So, long winded way of saying, just depends.
Jeremy Falcon
|
|
|
|
|
having used lua, I can concur that:
- it's fast
- it's small
- it's powerful
but I can also say that it's esoteric and likely "not like other programming languages your org is using", especially if you were considering python.
it's built-for-purpose, and good at that purpose, but I hated writing code for the Lua runtime. Always felt kludgy, and I was never sure exactly what I was doing wrong when I was doing something wrong. Perhaps the latter would have faded with time, but with quite a few programming languages under my belt (C, C++, Tcl, Python, PHP, C#, F#, JS; plus the ones people will discount like SQL & sh, and even the ones I've used less like Ruby, Perl), Lua was (imo) unintuitive and painful to use. Could well be a personal problem as I know other people who love it - but if you get this kind of feedback from the people who would be writing code for the platform, I'm here to nod and agree.
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing
Which is stupid.
|
|
|
|
|
Totally agree that Lua isn't my favorite language at all. But, if the goal is to integrate within an application then using a language specifically designed for that is a lot better and safer than one that's not - which is the point. There's no telling what package you can get from the python world, etc.
It's meant to automate, no different than VBA.
Jeremy Falcon
|
|
|
|
|
I hear you on the automation part.
My experience has been that the host has full control over the sanbox in all 3 embedded languages we've used (py, js, c#). If we're concerned about embedding and security, the place for most scrutiny is the code users are putting in 😉
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing
Which is stupid.
|
|
|
|
|
charlieg wrote: embedding python into the application such that the tests would be driven by script rather than some embedded file format
There are multiple QA testing frameworks. I am not referring to developer unit testing frameworks but rather applications that can interact with applications themselves. That includes UI and Rest at least since I have seen both of those. Probably others.
So those are already in use but are not sufficient?
|
|
|
|
|
Well, I'm not actually testing the UI. What I am doing is developing a test system (hardware) that interfaces to the unit under test. I have heard that "it's useful to embed a scripting language" into an application, allowing users to develop their own procedures and what not.
I'm having trouble getting my head around the general concept. More to follow below.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
We use TestComplete | SmartBear Software to test a legacy application whose source code just acquired. It is a Delphi 7 application, so we use the deep integration through the executable compiled with debug info. Either it makes a macro recording like script, or one can write a script using one of the supported languages
|
|
|
|