Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. split on newlines AND commas AND semi-colons
  2. people = "Abby Andrews, Ben rnCharlie Connors    Daphne D., Ernie E. Engels; FayernrnGary Gomez"
  3.  
  4. array = people.split('??')
  5.        
  6. array = people.split(
  7.     /s*[,;]s* # comma or semicolon, optionally surrounded by whitespace
  8.     |           # or
  9.     s{2,}      # two or more whitespace characters
  10.     |           # or
  11.     [rn]+     # any number of newline characters
  12.     /x)