Skip to content
Hicken Design

Hicken Design

making complexity simple

Tag: any character

Posted on November 8, 2011February 1, 2012

Regular Expressions “Any Character” in Javascript

The problem:
In Javascript Regular Expressions, the dot character (.) doesn’t truly represent any character.  It leaves out new lines.

The solution:
Rather than using the dot character, try using [\s\S] which matches both whitespace and non-whitespace characters.  This equates to a true “Any Character”.

Categories

  • Finance
  • General Posts
  • Mobile
  • Photography
  • Psychology
  • Technical

I am Mark Hicken. I currently work as a Sr. Software Engineer at Adobe.

All content you see on this site is my own opinion, based on my own experience and does not represent Adobe.