Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Conversation

@AndersDJohnson
Copy link
Contributor

@AndersDJohnson AndersDJohnson commented Oct 26, 2020

Description

Enhances the GitHub URL regex to only match issue URLs rather than any GitHub URL with digits in the path, to support multiple subdomains for some companies, to not limit supported domain and owner and repo names to basic A-Z character set but to support other ASCII or Unicode characters, etc. - all while retaining the fix from #86, mostly by using a [^\s] pattern to avoid matching whitespace.

Motivation and Context

There were some false positives and some cases where existing regex wouldn't quite work.

How Has This Been Tested?

  • unit tests?

Existing unit tests pass. Added some more unit tests that fail without the changes but pass with.

Without changes:
Screen Shot 2020-10-26 at 6 46 20 AM

With changes:
Screen Shot 2020-10-26 at 6 49 21 AM

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (updating repository quality of life, like deps, linting, etc.)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@AndersDJohnson AndersDJohnson marked this pull request as ready for review October 26, 2020 12:00
@AndersDJohnson AndersDJohnson added 🐛 fix Something isn't working 📦 refactor Refactoring a portion of the code ✨ feat New feature or request labels Oct 26, 2020
Copy link
Contributor

@therynamo therynamo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 awesome! 🚀

These changes make way more sense. Regex... I tell ya 😄

Thank you for making a pr!

@therynamo therynamo merged commit 4713d9e into master Oct 26, 2020
@therynamo therynamo deleted the github-regex branch October 26, 2020 13:25
therynamo pushed a commit that referenced this pull request Mar 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🐛 fix Something isn't working hacktoberfest-accepted HACKTOBER! 📦 refactor Refactoring a portion of the code ✨ feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants