Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Copy to Clipboard Button for Regex Templates #534

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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

Successfully merging this pull request may close these issues.

1 participant