I've built a program in Java to translate a assembly code to machine code, I'm using this regex to do it:
^((?<label>.*):)?\s*(?<instruction>\w+)(\s+(?<op1>\w+))?(\s+(?<op2>\w+))?(;\s+(?<comment>.*))?$
I've tried to use standard regex.h, if I take the group names out it compiles but does not work because the optional groups ()? are treated as select groups...
It's really hard to search in Google because everything is about C# and not C. I understand that Java, Python, JavaScript or even C# would make my life easier, but I need to do it in C. If I can't use regex, it will become a sscanf challenge.
Is there a way to convert this regex to C regex or there is a C equivalent for java.util.regex?