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.