Shell
5 mo. ago
Regex pattern to add link text to title attribute.
# Find all <a> tags and capture href and text into groups 1, 2# $1 is ([^"]+) matches any character except "# $2 is ([^<]+) matches any character except <<a\s+href="([^"]+)"[^>]*>([^<]+)</a>
# Add title attribute to <a> tags<a href="$1" target="_blank" rel="noopener" title="$2">$2</a>