I have a list of 429 MFC resource files that I have to generate a list of shortcuts for, which would be buttons containing an ampersand symbol (e.g. BUTTON "&Close") indicating that ALT-C is the shortcut for closing that particular dialog.
The problem is that the resource files contain many different dialogs formatted as such:
IDD_VIDEO DIALOG 0, 0, 471, 187
...
BEGIN
...
PUSHBUTTON "&Close",IDC_CLOSE,89,166,53,14
...
END
The format I would like to pull out would be a list of "&Close" (Or ideally "ALT-C &Close") and other labels with shortcuts, sectioned by which dialog they're under (e.g. IDD_VIDEO). Regex seems like the best solution but I haven't been able to figure a working regex out for this yet.
Thanks for the added specifications. This should work:
This will match the entire section from
IDD_whatever
until the nextEND
. Then you need to take that string and apply the following regex to it:Here's a C# example:
Of course this code snippet doesn't do anything with
identifier
andaltCString
, but I think you get the idea.