mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-01-30 07:08:01 -08:00
Compare commits
4 Commits
a38ef694c5
...
aaa87b19d6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaa87b19d6 | ||
|
|
d143c60246 | ||
|
|
44371217a9 | ||
|
|
e5303d7ea0 |
@@ -602,3 +602,8 @@ echo $host; // domain-name.com
|
|||||||
$text = "A regular expression (shortened as regex) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for 'find' or 'find and replace' operations on strings, or for input validation.";
|
$text = "A regular expression (shortened as regex) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for 'find' or 'find and replace' operations on strings, or for input validation.";
|
||||||
$text = preg_replace("/\b(regex)\b/i", 'replaced content', $text);
|
$text = preg_replace("/\b(regex)\b/i", 'replaced content', $text);
|
||||||
echo $text; /*A regular expression (shortened as replaced content) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for 'find' or 'find and replace' operations on strings, or for input validation.*/
|
echo $text; /*A regular expression (shortened as replaced content) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for 'find' or 'find and replace' operations on strings, or for input validation.*/
|
||||||
|
|
||||||
|
// spread operator > PHP 7.4
|
||||||
|
$array1 = [1, 2, 3];
|
||||||
|
$array2 = [4, 5, 6];
|
||||||
|
$merge_array = [0, ...$array1, ...$array2]; // [0, 1, 2, 3, 4, 5, 6]
|
||||||
@@ -105,7 +105,7 @@ gu$ make lowercase until end of line
|
|||||||
<< indent line one column to left
|
<< indent line one column to left
|
||||||
== auto-indent current line
|
== auto-indent current line
|
||||||
ddp swap current line with next
|
ddp swap current line with next
|
||||||
ddkp swap current line with previous
|
ddkP swap current line with previous
|
||||||
:%retab fix spaces / tabs issues in whole file
|
:%retab fix spaces / tabs issues in whole file
|
||||||
:r [name] insert the file [name] below the cursor.
|
:r [name] insert the file [name] below the cursor.
|
||||||
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
||||||
|
|||||||
Reference in New Issue
Block a user