treehouse : what would you like to learn today?
Web Design Web Development iOS Development

regular expression

  • Hi,

    I got to work with a mess code. Want to validate it and look more consistent.

    How to search for images that do not have ending /
    ?

    And no, I cannot search by
    alt="">
    ">

    <img src="" width="" height="" alt="">
    <img src="" width="" height="" alt="" />

  • Yup, I have accumulated quite a few handy regex's and that is one of them: <img([^>]+)(\s*[^\/])>

    That can obviously be adjusted to suit any self-closing tag...