-
-
Save sam113101/8e5d9b6f356612937f88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> "<h1>Hello World</h1>\n[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-1.mp3\"][/audio]\n[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-2.mp3\"][/audio]\n<p style=\"color: red\">Stuff</p>\n".scan(/\[audio (\w+)=\"(.+)\"\]\[\/audio\]/) | |
=> [["mp3", "http://wordpress.dev/wp-content/uploads/2015/01/episode-1.mp3"], ["mp3", "http://wordpress.dev/wp-content/uploads/2015/01/episode-2.mp3"]] | |
[2] pry(main)> "<h1>Hello World</h1>\n[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-1.mp3\"][/audio]\n[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-2.mp3\"][/audio]\n<p style=\"color: red\">Stuff</p>\n".scan(/(\[audio (\w+)=\"(.+)\"\]\[\/audio\])/) | |
=> [["[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-1.mp3\"][/audio]", "mp3", "http://wordpress.dev/wp-content/uploads/2015/01/episode-1.mp3"], ["[audio mp3=\"http://wordpress.dev/wp-content/uploads/2015/01/episode-2.mp3\"][/audio]", "mp3", "http://wordpress.dev/wp-content/uploads/2015/01/episode-2.mp3"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment