Skip to content

Commit

Permalink
Merge pull request #50 from CMSgov/txt-generator
Browse files Browse the repository at this point in the history
allow domain names in urls not starting with www
  • Loading branch information
eoverly authored Nov 20, 2024
2 parents 14a0acc + 625e069 commit 2a5cbbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/txt-generator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const removeIndex = (array, index) => [
]

const urlRegex = new RegExp(
/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/
/^(https?:\/\/(?:|(?!))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:\.|(?!))[a-zA-Z0-9]+\.[^\s]{2,}|\.[a-zA-Z0-9]+\.[^\s]{2,})$/
)

const TxtGenerator = () => {
Expand Down

0 comments on commit 2a5cbbf

Please sign in to comment.