Remove start and end slashes and JS modifier from regex patterns.