I have this regex: /href=('|")(\w+|\/dashboard)/ that matches every HTML anchor that has an href that starts with /dashboard, or something/without/a/slash/at/the/beginning.
So this regex matches:
<a href="/dashboard/security-settings"></a>
<a href='dashboard/security-settings'></a>
<a href='something/security-settings'></a>
But not:
<a href="/home"></a>
<a href="/about"></a>
The issue here is that it also matches:
<a href="http://www.google.com"></a>
<a href="www.facebook.com"></a>
How can I filter href's starting with http or www from the regex? I tried playing with the ^ operator with no luck:
href=('|")(([^http][^www]|\w+)|\/dashboard)