RegEx Choosing All Link Inside Href Ends with Html Extension
250

To get all the href tags from beginning to the end, you can use this RegEx.

In this example, it was focused on choosing all href links ends with .html extension.


Here is the RegEx:

href="(w+.html)"

Here is breakdown of how this regular expression works:

  • href=" matches the literal string href=".
  • (w+.html) matches one or more word characters (letters, numbers, and underscores) followed by the literal string .html. The parentheses capture the matched word and the extension as a group.

So, this regular expression will match any word inside href="" that ends with the .html extension, such as href="page.html" or href="folder/my-page.html". Note that this regular expression assumes that the href attribute is enclosed in double quotes, as is common in HTML. If the attribute is enclosed in single quotes, you can modify the regular expression to use single quotes instead.

If you are looking for consultation, fill the Contact Form below.
Innovation distinguishes between a leader and a follower. Steve Jobs
Haluk YAMANER - Personal
Contact Form
You must complete Security Verification to submit your form.