Added a regex to write less code

Added a regex to write less code