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
+29-13Lines changed: 29 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,29 @@
2
2
3
3
Eloquent Regex brings the simplicity and elegance to regular expressions. Designed for Laravel developers, this package offers a fluent, intuitive interface for building and executing regex patterns in your PHP applications.
-[Creating a Custom Pattern](#creating-a-custom-pattern)
16
+
-[Applying Quantifiers](#applying-quantifiers)
17
+
-[Optional Elements](#optional-elements)
18
+
-[Specifying a Range](#specifying-a-range)
19
+
-[One or More](#one-or-more)
20
+
-[Zero or More](#zero-or-more)
21
+
-[Exact Number](#exact-number)
22
+
-[Custom Character Sets and Groups](#custom-character-sets-and-groups)
23
+
-[Quantifier Values](#quantifier-values)
24
+
5
25
# Overview
6
26
7
-
### Dreaming of a world where regex doesn't feel like a rocket science? 😄🚀
27
+
####Dreaming of a world where regex doesn't feel like a rocket science? 😄🚀
8
28
9
29
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
30
@@ -222,7 +242,7 @@ Quantifiers in regular expressions are symbols or sets of symbols that specify h
222
242
223
243
### Optional Elements
224
244
225
-
To make an element optional, use '?'. This matches zero or one occurrence of the preceding element.
245
+
To make an element optional, use '?'. This matches zero or one occurrence of the preceding element (`dash` in this example).
226
246
227
247
```php
228
248
// Matches a string that may or may not contain a dash
@@ -237,7 +257,7 @@ For specifying a range of occurrences, use a string with two numbers separated b
In [Special characters](https://github.com/MaestroError/eloquent-regex/blob/documentation-and-examples/src/Traits/BuilderPatternTraits/SpecificCharsTrait.php)
nearly all methods allowing quantifiers with values:
310
+
and [Groups](https://github.com/MaestroError/eloquent-regex/blob/documentation-and-examples/src/Traits/BuilderPatternTraits/GroupsTrait.php) - nearly all methods allowing quantifiers with values:
293
311
294
312
- Zero or More = `"zeroOrMore"`, `"0>"`, `"0+"`, `"*"`
295
313
- One or More = `"oneOrMore"`, `"1>"`, `"1+"`, `"+"`
296
314
- Optional (Zero or One) = `"optional"`, `"?"`, `"|"`
0 commit comments