Regular Expression To Match IMG Tag Without Forward Slash

A Regular Expression to match all <img> tags without forward slash (/).

/<img([^>]*[^/])>/

Matches:

  • <img src=”/path/to/image”>

Non-matches:

  • <img src=”/path/to/image” />
Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.