You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1025,7 +1027,9 @@ Testing and debugging are critical steps in ensuring your regex patterns do exac
1025
1027
1026
1028
# Contributing to EloquentRegex
1027
1029
1028
-
We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help makes EloquentRegex even better for everyone. We follow the classic GitHub contribution flow. Here's how you can get involved:
1030
+
We welcome contributions from the community! Whether you're fixing bugs, adding new features, or improving documentation, your help makes EloquentRegex even better for everyone. We follow the classic GitHub contribution flow. Below is how you can get involved.
1031
+
1032
+
_Note: Checking [STRUCTURE.md](https://github.com/MaestroError/eloquent-regex/blob/update-documentation-and-add-advanced-usage-section/STRUCTURE.md) out may help you understand the package better 👍_
**Pull Request (PR):** Navigate to the original EloquentRegex repository on GitHub. You'll see an option to "Compare & pull request" for your branch. Click it to begin the process of submitting a PR.
1070
+
1.**Pull Request (PR):** Navigate to the original EloquentRegex repository on GitHub. You'll see an option to "Compare & pull request" for your branch. Click it to begin the process of submitting a PR.
1067
1071
1068
-
**Describe Your Changes:** Provide a detailed description of the changes in the PR. Include any relevant issue numbers. Explaining the reasoning behind the changes and how they improve EloquentRegex will help reviewers understand your contribution.
1072
+
2.**Describe Your Changes:** Provide a detailed description of the changes in the PR. Include any relevant issue numbers. Explaining the reasoning behind the changes and how they improve EloquentRegex will help reviewers understand your contribution.
1069
1073
1070
-
**Submit for Review:** Once your PR is ready and all checks pass, submit it for review. At least one review from the project maintainers is required for merging. Be open to feedback and ready to make further tweaks based on suggestions.
1074
+
3.**Submit for Review:** Once your PR is ready and all checks pass, submit it for review. At least one review from the project maintainers is required for merging. Be open to feedback and ready to make further tweaks based on suggestions.
A project like EloquentRegex doesn't come to life in isolation. It's the result of inspiration, assistance, and support from various tools and communities. We would like to extend our heartfelt thanks to the following:
1101
+
1102
+
-**[Regexr:](https://regexr.com/)** For being an invaluable tool in the creation and debugging of regex patterns. Its intuitive interface and detailed explanations have made it possible to refine and perfect our regex expressions.
1103
+
1104
+
-**[ChatGPT:](https://chat.openai.com/)** For its assistance in covering the full codebase with PEST tests. [ChatGPT's](https://openai.com/) guidance and suggestions have also been important in creation of this documentation.
1105
+
1106
+
-**[PEST Framework:](https://pestphp.com/)** For being an incredibly user-friendly and expressive testing framework. Its elegant syntax and powerful features have made writing tests a joy, contributing significantly to the quality of EloquentRegex.
1107
+
1108
+
A special thank you goes out to everyone who has contributed to these tools and resources. Your work has not only aided in the development of EloquentRegex but has also contributed to the broader developer community by providing tools and knowledge that empower us all.
1109
+
1110
+
# Frequently Asked Questions (FAQ)
1111
+
1112
+
### What is EloquentRegex?
1113
+
1114
+
EloquentRegex is a PHP/Laravel package designed to simplify the creation and execution of regular expressions. It offers a fluent, intuitive interface for both building custom regex patterns and utilizing ready-to-use patterns for common tasks like email and URL validation.
1115
+
1116
+
### How do I install EloquentRegex?
1117
+
1118
+
EloquentRegex can be installed via Composer. Run the following command in your Laravel project directory:
1119
+
1120
+
```bash
1121
+
composer require maestroerror/eloquent-regex
1122
+
```
1123
+
1124
+
### Can I use EloquentRegex without Laravel?
1125
+
1126
+
While EloquentRegex is specifically designed with Laravel in mind, the core functionality can be used in any PHP project via `Maestroerror\EloquentRegex\EloquentRegex` object with **the same syntax**.
1127
+
1128
+
```php
1129
+
use Maestroerror\EloquentRegex\EloquentRegex;
1130
+
```
1131
+
1132
+
### How do I use ready-to-use patterns?
1133
+
1134
+
Ready-to-use patterns can be invoked by calling the corresponding method on the EloquentRegex class. For example, to validate an email address:
Custom patterns can be created using the `start` or `customPattern` method. From there, you can chain methods to build your pattern:
1143
+
1144
+
```php
1145
+
$result = EloquentRegex::start('user_123')
1146
+
->alphanumeric()
1147
+
->underscore()
1148
+
->digits()
1149
+
->get();
1150
+
```
1151
+
1152
+
### Can I apply options to any pattern?
1153
+
1154
+
Yes, any options can be applied to any pattern using either a callback function or an associative array. This allows for flexible configuration of your regex patterns. Also, direct arguments to the pattern methods are used as extra, easy-to-use way for applying options.
1155
+
1156
+
### How do I debug my regex patterns?
1157
+
1158
+
You can use the `toRegex()` method to get the raw regex pattern string. This can then be tested and debugged using online tools like [Regexr](https://regexr.com/), which provides real-time matching and detailed explanations. Check the [Testing and Debugging](##testing-and-debugging-your-regex-patterns) section for more information.
1159
+
1160
+
### How can I contribute to EloquentRegex?
1161
+
1162
+
Contributions are welcome! You can contribute by forking the GitHub repository, making your changes, and submitting a pull request. Please ensure your contributions adhere to the project's coding standards and guidelines.
1163
+
1164
+
### Where can I report issues or request features?
1165
+
1166
+
Issues and feature requests can be submitted on the GitHub repository's Issues page. Please provide as much detail as possible to help us understand and address your request efficiently.
1167
+
1168
+
### How do I stay updated on EloquentRegex developments?
1169
+
1170
+
To stay updated, follow the GitHub repository for the latest changes, releases, and discussions. You can also watch the repository to receive notifications for all project activities or follow the [author's page](https://www.linkedin.com/in/maestroerror/).
1171
+
1172
+
---
1173
+
1094
1174
##### To Do
1095
1175
1096
1176
- Return captured groups while using `group()` method with `get()`.✔️
@@ -1107,7 +1187,7 @@ Or use QR code:
1107
1187
- Implement usage of named groups: `/(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})/`
1108
1188
- Add some tool for debuging options
1109
1189
1110
-
- Write documentation (add credit for https://regexr.com/ and ChatGPT)
1190
+
- Write documentation
1111
1191
- Create quick start guide and add in Docs.
1112
1192
- Add advanced usage section in Docs:
1113
1193
- Options and Assertions: Detailed explanation of options, how to apply them, and their effects on patterns. ✔️
@@ -1126,8 +1206,8 @@ Or use QR code:
1126
1206
- Testing and Debugging ✔️
1127
1207
- Support ✔️
1128
1208
- Contributing (+STRUCTURE.md) ✔️
1129
-
- Credits
1130
-
- FAQs
1209
+
- Credits (add credit for https://regexr.com/ and ChatGPT) ✔️
0 commit comments