Skip to content

Conversation

israelbls
Copy link

Firstly, I want to express my admiration for this fantastic and incredibly useful tool you’ve built! Regexr has been an amazing resource for developers like me, and I deeply appreciate the effort and thought that has gone into making such a valuable application.

While using the app, I noticed that there wasn’t an easy way to quickly copy a regex expression after testing or modifying it. I believe this feature would be highly beneficial, as it would allow users to seamlessly copy a regex expression once they’ve validated it, making the tool even more efficient for day-to-day use.

To address this, I’ve added a Copy to Clipboard button next to each regex template. Here’s what this new feature includes:

  • A clearly visible button next to the regex templates.
  • Clicking the button instantly copies the corresponding regex expression to the user’s clipboard.
  • A success alert notifies the user that the expression was successfully copied.

This small addition aims to improve the user experience by saving time and making the application more convenient.

Code Changes:
The only functional change in the code is within the _initUI(el) function, where I added the logic to implement the Copy to Clipboard button. All other changes in the codebase are purely formatting adjustments made automatically by the Prettier extension, so they can be safely ignored.

I’ve tested the functionality to ensure it works across different scenarios, and I’ve also styled the button to align with the overall design of the app.

Thank you for considering this contribution! I’m happy to make any adjustments or discuss further if needed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant