Skip to content

Instantly share code, notes, and snippets.

View jonjomckay's full-sized avatar
🚀
¯\_(ツ)_/¯

Jonjo McKay jonjomckay

🚀
¯\_(ツ)_/¯
View GitHub Profile
@jonjomckay
jonjomckay / song.rb
Created September 9, 2012 15:19 — forked from natew/song.rb
Rails model for parsing artist information from a song
class Song
# Regular expressions
RE = {
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i,
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i,
:mashup_split => / \+ | x | vs\.? /i,
:producer => /^(produced by|prod\.? by |prod\. )/i,
:cover => / cover/i,
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three"
:open => /[\(\[\{]/,