Skip to main content
2 of 2
Update
Duc Le
  • 3.8k
  • 2
  • 8
  • 28

Using AMPscript RegExMatch function would help to get the URL.

Update to get both URL and link text. Try this:

%%[
  set @html = AttributeValue('Your column name');

  set @url_Pattern = '(?<=href=").*(?=")'
  set @linkText_Pattern = '(?<=>).*(?=<a>)'

  set @url = RegExMatch(@html, @url_Pattern, 0)
  set @linkText = RegExMatch(@html, @linkText_Pattern, 0)
]%%

URL: %%=v(@url)=%%<br>
Link Text: %%=v(@linkText)=%%

Reference: RegExMatch function

Duc Le
  • 3.8k
  • 2
  • 8
  • 28