Regex To Match The First X Characters In A Sentence

A useful Regex that matches the first X (30 in the example below) characters (including space) in a sentence.

/^([\s\S]){1,20}([\s\.])/

Matches:

  • A useful Regext that matches the first X (30 in the example below) characters (including space) in a sentence.

See Also: