Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(\w{2}).*?\b
/
gm

Description

It grabs 2 first characters from a word. So:

  • please will be pl
  • sure and sun will be su
  • white and what will be wh

Go to substitute mode for the result to appear :)

Submitted by anonymous - 2 years ago