$anchorswill hold the results):
preg_match_all('~<a\s+.*?</a>~is',$string,$anchors);If however you want to parse individual attributes or just the "text" of the anchor etc. then using a DOM parser would definitely be better.
since you are using regex buddy,
<a\s+.*?</a>is the actual pattern and
isare modifiers for making it case-insensitive (i) and also allowing the dot to match newline chars (s), in the event that the "text" inside the anchor tags has newline chars (so IOW make sure to add those flags in regex buddy)