2 ms·
The best way would be to make an escape code that matches zero or one punctuation. So you's search for "/first\_name/i".
by marcosdumay 2y ago
The best way would be to make an escape code that matches zero or one punctuation.
So you's search for "/first\_name/i".
- Izkata 2y agoThat already exists as "?" and was used in their example: /first[-_]?name/i Or to use your example, just checking for underscores and not also dashes: /first_?name/i Backslash is already used to change special characters like "?" from these meanings into just "use this character without interpreting it" (or the reverse, in some dialects).