I'm attempting to create a regex that allows identification of strings that are operands in assembly code. In order to do this I need to identify various addressing mode styles within the assembly code.
I have this regex: ([$\(\),#])\w+/g
which correctly identifies all of the operands in the following text, however regexr.com is telling me that the regex doesn't identify the parentheses in the line containing the LDA instruction.
How do I need to modify this regex so that it also includes the parentheses?
begin
LDA #10 ;load $0A into accumulator
LDX $15 ;load $15m into X
_loop TAX ;transfer A to X
SEC ;set carry flag
_branch ADC $10 ;add with carry instruction on absolute memory address 0x0A
STA $3000,X
LDA ($40),Y
end