Skip to content

Commit 1662daf

Browse files
committed
fixes in Docs
1 parent ac3c26c commit 1662daf

File tree

1 file changed

+75
-23
lines changed

1 file changed

+75
-23
lines changed

README.md

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Eloquent Regex brings the simplicity and elegance to regular expressions. Design
44

55
# Overview
66

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? 😄🚀
88

99
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!
1010

@@ -31,7 +31,7 @@ Simply install the package via Composer, and you're ready to take the pain out o
3131
composer require maestroerror/eloquent-regex
3232
```
3333

34-
Later, Here will be added our quick start guide.
34+
Later, here will be added our quick start guide.
3535

3636
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.
3737

@@ -45,7 +45,7 @@ First of all, you need to include EloquentRegex class.
4545
use Maestroerror\EloquentRegex\EloquentRegex;
4646
```
4747

48-
Recomended for **Laravel:**
48+
**Recomended for Laravel:**
4949

5050
```php
5151
use Maestroerror\EloquentRegex\Facades\EloquentRegex;
@@ -59,21 +59,21 @@ Usage structure is very similar to Laravel's Eloquent ORM, check this out:
5959

6060
Let's break it down:
6161

62-
- _Initiator_ sets the target string
62+
- **_Initiator_** sets the target string
6363

6464
```php
6565
EloquentRegex::source($yourString);
6666
```
6767

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:
6969

7070
```php
7171
EloquentRegex::source($yourString)->url();
7272
```
7373

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_
7575

76-
- _Action_ are execution methods, check the example:
76+
- **_Action_** is the execution method, check the example:
7777

7878
```php
7979
// 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
102102

103103
Here you can check all available methods of ready-to-use patterns and their arguments:
104104

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 `"$, ₾"`
119-
- `filePath(int $isDirectory, bool $isFile, bool $fileExists,string $pathType)` - $pathType allowed values: `absolute` & `relative`
120-
- `filePathWin(int $isDirectory, bool $isFile, bool $fileExists)`
105+
```php
106+
textOrNumbers(int $minLength, int $maxLength, int $minUppercase, int $minLowercase, int $minNumbers, int $maxNumbers)
107+
```
108+
109+
```php
110+
// $onlyDomains & $onlyExtensions array or string separated by comma `"example.org,example.com"`
111+
email(int $maxLength, array|string $onlyDomains, array|string $onlyExtensions)`
112+
```
113+
114+
````php
115+
url(array|string $onlyProtocol)`
116+
```php
117+
// $onlyDomains & $onlyExtensions array or string separated by comma "org,com"
118+
domainName(int $maxLength, array|string $onlyDomains, array|string $onlyExtensions)`
119+
````
120+
121+
```php
122+
date()
123+
```
124+
125+
```php
126+
time()
127+
```
128+
129+
```php
130+
ipAddress()
131+
```
132+
133+
```php
134+
ipv6Address()
135+
```
136+
137+
```php
138+
// $cardTypes string separated by comma "visa, amex"
139+
creditCardNumber(string $cardTypes)
140+
```
141+
142+
```php
143+
// $countryCode should passed without "+" sign: phone("1"), phone("995")
144+
phone(string $countryCode)
145+
```
146+
147+
```php
148+
username(int $maxLength)
149+
```
150+
151+
```php
152+
password(int $minLength, int $minUppercase, int $minNumbers, int $minSpecialChars)
153+
```
154+
155+
```php
156+
// $restrictTags & $onlyTags array or string separated by comma `"script, style"`. It isn't recomended to use both option in simultaneously
157+
htmlTag(array|string $restrictTags, array|string $onlyTags)
158+
```
159+
160+
```php
161+
// $specificCurrencies array of currency symbols or string separated by comma "$, ₾"
162+
currency(int $minDigits, int $maxDigits, array|string $specificCurrencies)
163+
```
164+
165+
```php
166+
// $pathType allowed values: "absolute" & "relative"
167+
filePath(int $isDirectory, bool $isFile, bool $fileExists,string $pathType) -
168+
```
169+
170+
```php
171+
filePathWin(int $isDirectory, bool $isFile, bool $fileExists)
172+
```
121173

122174
#### Quantifiers
123175

0 commit comments

Comments
 (0)