Consider the following strings:
1 Post 12:34
4 Posts 15:11
Deleted 8:46
I need to get the first part with the number and exclude the second timestamps: This is what I've tried, but I get null for "deleted".
var poststatus = posts.match(/(^)[\d](?<!^)[\D\:] /);
CodePudding user response:
Give this a try:
/(.| )*(?= \d :\d )/g