exported the "wmatch" function