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
Copy file name to clipboardExpand all lines: README.md
+75-23Lines changed: 75 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Eloquent Regex brings the simplicity and elegance to regular expressions. Design
4
4
5
5
# Overview
6
6
7
-
### Dreaming of a world where regex doesn't feel like rocket science? 😄🚀
7
+
### Dreaming of a world where regex doesn't feel like a rocket science? 😄🚀
8
8
9
9
Regular expressions (regex) are powerful, no doubt. They're the Swiss Army knife for string manipulation and validation. But let's be honest, they can also be a bit of a headache. The syntax is dense, and a tiny mistake can throw everything off. It's like they're designed to be as intimidating as possible, especially when you're just trying to validate an email address!
10
10
@@ -31,7 +31,7 @@ Simply install the package via Composer, and you're ready to take the pain out o
31
31
composer require maestroerror/eloquent-regex
32
32
```
33
33
34
-
Later, Here will be added our quick start guide.
34
+
Later, here will be added our quick start guide.
35
35
36
36
Remember, regex doesn't have to be a source of frustration. With EloquentRegex, you're on your way to becoming a regex master, all while writing cleaner, more maintainable Laravel code.
37
37
@@ -45,7 +45,7 @@ First of all, you need to include EloquentRegex class.
45
45
use Maestroerror\EloquentRegex\EloquentRegex;
46
46
```
47
47
48
-
Recomended for **Laravel:**
48
+
**Recomended for Laravel:**
49
49
50
50
```php
51
51
use Maestroerror\EloquentRegex\Facades\EloquentRegex;
@@ -59,21 +59,21 @@ Usage structure is very similar to Laravel's Eloquent ORM, check this out:
59
59
60
60
Let's break it down:
61
61
62
-
-_Initiator_ sets the target string
62
+
-**_Initiator_** sets the target string
63
63
64
64
```php
65
65
EloquentRegex::source($yourString);
66
66
```
67
67
68
-
-_Pattern_ Could be method for one of the ready-to-use patterns or your custom pattern (we will talk about custom pattern later). Let's keep the example simple and add url pattern:
68
+
-**_Pattern_** Could be method for one of the ready-to-use patterns or your custom pattern (we will talk about custom pattern later). Let's keep the example simple and add url pattern:
69
69
70
70
```php
71
71
EloquentRegex::source($yourString)->url();
72
72
```
73
73
74
-
_Note: **Optional** methods mostly are the expression flags, we will talk about them in next sections_
74
+
_Note: **?Optional** methods mostly are the expression flags, we will talk about them in next sections_
75
75
76
-
-_Action_ are execution methods, check the example:
76
+
-**_Action_** is the execution method, check the example:
77
77
78
78
```php
79
79
// get() will return array/collection of URLs if any found in $yourString
@@ -102,22 +102,74 @@ We have different ways to apply options, but the most common and easy way is to
102
102
103
103
Here you can check all available methods of ready-to-use patterns and their arguments:
104
104
105
-
-`textOrNumbers(int $minLength, int $maxLength, int $minUppercase, int $minLowercase, int $minNumbers, int $maxNumbers)`
106
-
-`email(int $maxLength, array|string $onlyDomains, array|string $onlyExtensions)` - $onlyDomains & $onlyExtensions array or string separated by comma `"example.org,example.com"`
107
-
-`url(array|string $onlyProtocol)`
108
-
-`domainName(int $maxLength, array|string $onlyDomains, array|string $onlyExtensions)` - $onlyDomains & $onlyExtensions array or string separated by comma `"org,com"`
109
-
-`date()`
110
-
-`time()`
111
-
-`ipAddress()`
112
-
-`ipv6Address()`
113
-
-`creditCardNumber(string $cardTypes)` - $cardTypes string separated by comma `"visa, amex"`
114
-
-`phone(string $countryCode)` - $countryCode should passed without "+" sign: `phone("1")`, `phone("995")`
115
-
-`username(int $maxLength)`
116
-
-`password(int $minLength, int $minUppercase, int $minNumbers, int $minSpecialChars)`
117
-
-`htmlTag(array|string $restrictTags, array|string $onlyTags)` - $restrictTags & $onlyTags array or string separated by comma `"script, style"`. It isn't recomended to use both option in simultaneously
118
-
-`currency(int $minDigits, int $maxDigits, array|string $specificCurrencies)`- $specificCurrencies array of currency symbols or string separated by comma `"$, ₾"`
0 commit comments