Adjust regexp filtering test to support other ruby versions