/<a>(.*?)<\/a>/
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_match
/<a>(.*?)<\/a>/s
The "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