This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| php [2021/05/01 11:36] admin | php [2021/05/02 11:26] (current) admin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| Start php server ```php -S 127.0.0.1:8000```\\ | Start php server ```php -S 127.0.0.1:8000```\\ | ||
| Open browser and enter ```http://localhost:8000/file-name.php``` | Open browser and enter ```http://localhost:8000/file-name.php``` | ||
| + | |||
| + | |||
| + | ## Regular Expression | ||
| + | |||
| + | https://regexr.com | ||
| + | |||
| + | ### Flags | ||
| + | |||
| + | https://javascript.info/regexp-introduction Regular expressions may have flags that affect the search. | ||
| + | |||
| + | There are only 6 of them in JavaScript: | ||
| + | <file> | ||
| + | i | ||
| + | With this flag the search is case-insensitive: no difference between A and a (see the example below). | ||
| + | g | ||
| + | With this flag the search looks for all matches, without it – only the first match is returned. | ||
| + | m | ||
| + | Multiline mode (covered in the chapter Multiline mode of anchors ^ $, flag "m"). | ||
| + | s | ||
| + | Enables “dotall” mode, that allows a dot . to match newline character \n (covered in the chapter Character classes). | ||
| + | u | ||
| + | Enables full Unicode support. The flag enables correct processing of surrogate pairs. More about that in the chapter Unicode: flag "u" and class \p{...}. | ||
| + | y | ||
| + | “Sticky” mode: searching at the exact position in the text (covered in the chapter Sticky flag "y", searching at position) | ||
| + | </file> | ||