MATCHES logic

83 views
Skip to first unread message

josephv...@gmail.com

unread,
May 12, 2023, 12:18:42 PM5/12/23
to OpenQM
I am looking to recreate the MATCHES function and was looking for guidance.  I'm not sure how to start; however, there are two reasons why I am wanting to create this function.  First, no matter what system I run the code, I know it will return what I expect despite their internal flags.  Second, I can add additional parameters and flags such as 0B for binary, or 0H for hexadecimal, as well as returning a tokenized array of data, etcetera.

My first question is how would I best handle the non-greedy 0X while still doing greedy 0A and 0N flags?  How should I handle multiple literals within the format string?  Anyone have any thoughts/pseudocode to share?  I'm pretty sure I couldn't see the source code for the actual MATCHES logic so I'm going in blind and hoping for the best.  It frustrates me that each platform handles this process differently so it is hard to have consistency.

Brian Speirs

unread,
May 12, 2023, 9:21:41 PM5/12/23
to OpenQM
I assume you mean that you wish to use MATCHES functionality on a non-MV system? After all, with MV, you can just use the MATCHES function.

Other systems usually use regular expressions, and the syntax of RegEx is well defined. Further, RegEx is well implemented within most languages. So, rather than trying to use a MATCHES expression, I would probably be trying to create an equivalent RegEx expression.

Cheers,

Brian

josephv...@gmail.com

unread,
May 13, 2023, 9:14:55 AM5/13/23
to OpenQM

Actually I want to do this in MV because different databases handle it differently and as a developer I cannot simply change underlying Universe settings on a client to fit my expectations of behavior or risk breaking other programs.

Thanks for the suggestion though.


Joseph

Brian Speirs

unread,
May 14, 2023, 3:56:30 PM5/14/23
to OpenQM
The source code for the GPL version of OpenQM is available on the web. Google for: OpenQM gplsrc . Alternatively, download the source code for ScarletDME - I doubt the MATCHES functionality has been changed from the original OpenQM implementation.

The MATCHES functionality is in op_str4.c

HTH,

Brian
Reply all
Reply to author
Forward
0 new messages