ex: <a><strike>example data in here</strike></a>
I want everything inside the a tag, to the end
/<a>([^<]*)<\/a>/
It works when there are no additional tags within the <a> tag, but what if there are?
I want to know if you can tell it to grab everything up to [^</a>] instead of [^<] only.
Doing it with /<a>(.*)<\/a>/ doesn’t work well. Sometimes I get everything in the <a> tag and other times I get tons of lines included in that call.
should work. The ? makes it lazy, so it grabs as little as possible before matching the
</a>part. but using . will mean that it matches everything until it finds</a>. If you want to be able to match across lines, you can use the following if with preg_matchThe "s" at the end puts the regular expression in "single line" mode, which means the . character matches all characters including new lines. See other useful modifiers