I know how to find a method in java using a fixed string,
someClass.getMethod('foobar', argTypes);
but is there a way to use a regular expression rather than a fixed string to find a method on a given class?
An example of the usage might be if I wanted to find a method that was called either ‘foobar’ or ‘fooBar’. Using a regular expression like ‘foo[Bb]ar’ would match either of these method names.
You should apply your regexp on getDeclaredMethods() reflection method (or GetMethods() if you want only the public ones).
[Warning: both methods will throw a SecurityException if there is a security manager.]
You apply it on each name of each method returned by getDeclaredMethod() and only memorize in a Collection the compliant Methods.
Something like!