I want to find an (overloaded) method X where the argument in position Y has the value Z.
Example:
AddMailToQueue("a", "b", "c", 2);
AddMailToQueue("a", "b", "c", 2, "d");
- X: AddMailToQueue
- Y: 4
- Z: 2
The method name X may or may not be prefixed (eg this.AddMailToQueue).
I came up with the following: .*AddMailToQueue\(.+2.*\); but this regex does not take into account the position of the argument and will also return matches where Z = 20, 21, etc.
My reasoning is that the comma separating the arguments can probably be used to pinpoint argument Y.