If you are looking for a sequence of letters or numbers, but not a mixed sequence, you can do this ...
"08-27-2015 07:25:00AM".match(/[a-zA-Z]+|[0-9]+/g)
as a result...
["08", "27", "2015", "07", "25", "00", "AM"]
On either side of |
we have a sequence of one or more letters and a sequence of one or more numbers. Therefore, when he meets a letter, he will collect all the continuous letters until he reaches the letter in which he collects all adjacent numbers, etc.
Any other character simply does not match, so it does not become part of the result.
user1106925
source share