A less obvious (but sometimes useful) way to escape regexp metacharacters is using the character class construct. For the example above, you could instead do this: /^([a-z]+)[.]html/