You can't. You need to figure out the number before setting it. Regular Expression won't work by just using it anywhere. They are usually used in object identification. Passing it just to one parameter of a method will not treat it as r.e. until unless the function parameter is expected to be a r.e.