Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试提出一个正则表达式来获取以下字符串:1:38P 并将其转换为有效格式以解析日期。我需要
var d = "1:38P"; var pat = /^(\d+:\d+)(A|P)$/; var m = pat.exec(d); if (m) { console.log('We have our winner' + 0 + m[1]}