I worked on something to help me with a daily task, and I thought I would share it. I know regular expressions are pretty technical, but I hope some of you find this interesting anyway. Here's the JavaScript for the Shortcut, and the website is: <a href="https://regex101.com" rel="nofollow noopener" target="_blank">https://regex101.com</a> <blockquote><strong>function run(input, parameters) {</strong></blockquote><blockquote><strong> var str = String(input[0]);</strong></blockquote><blockquote><strong> str = str.replace( /(.*) ((dd)s)/gm , `00:$2 $1`);</strong></blockquote><blockquote><strong> str = str.replace( /(.*) ((d)m (dd)s)/gm , `0$2:$3 $1`);</strong></blockquote><blockquote><strong> str = str.replace( /(.*) ((d)m (d)s)/gm , `0$2:0$3 $1`);</strong></blockquote><blockquote><strong> return "00:00 Intron"+str;</strong></blockquote><blockquote><strong>}</strong></blockquote>
Note: This is Club MacMost exclusive content. To view this video click the thumbnail below to go to the post as Patreon.com. Once there you will be able to view the video as long as you are logged into your Patreon account and a current supporter of MacMost at the "Club MacMost" or higher level.