Guest User

Untitled

a guest
Nov 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. function sentencesArray (text) {
  2. return text
  3. .replace(/([\s,]?[\d,-]?([A-Z][a-z]{3,}|[a-z]{2,}|[0-9])[.?!…\n]+([\s\n"]))/g, '$1|')
  4. .split('|')
  5. .map(s => s.trim())
  6. .filter(s => s)
  7. }
Add Comment
Please, Sign In to add comment