Hacker News new | ask | show | jobs
by Nadya 3496 days ago
Your hex value does not accept uppercase values. Might I suggest this instead:

    #([a-fA-F0-9]{3}){1,2}\b
Neither of ours accepts 8 character Hex values (transparency in 7th and 8th characters).

I have some more to share:

    Match the 'src' for images
    \< *[img][^\>]*[src] *= *[\"\']{0,1}([^\"\'\ >]*)

    Match ID's for Youtube Videos
    /http:\/\/(?:youtu\.be\/|(?:[a-z]{2,3}\.)?youtube\.com\/watch(?:\?|#\!)v=)([\w-]{11}).*/gi

    Match CSS comments
    \/\*[^*]*\*+([^/*][^*]*\*+)*\/

    Match every word except words in list:
    \bTarzan\b|\bJane\b|\bSuperman\b|(\w+);
1 comments

Thanks, those are great, I'll add them in.