A string will be made up of certain symbols (ax,bx,dx,c,acc for example) and numbers.
ex: ax 5 5 dx 3 acc c ax bx
I want to replace one or all of the symbols (randomly) with another symbol of the same set. ie, replace one of {ax,bx,dx,c,acc} with one of {ax,bx,dx,c,acc}.
replacement example: acc 5 5 dx 3 acc c ax bx or c 5 5 dx 3 acc c ax ax
Is there a way to do this with regexes? In Java? If so, which methods should I use?