正则表达式是一个可以帮助我们匹配复杂字符串模式的工具
.
[abcd]
[a-zA-Z]
[^abcd]
\d
\s
\t
\w
...
for fgbg in 38 48 ; do #Foreground/Background | |
for color in {0..256} ; do #Colors | |
#Display the color | |
echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m" | |
#Display 10 colors per lines | |
if [ $((($color + 1) % 10)) == 0 ] ; then | |
echo #New line | |
fi | |
done | |
echo #New line |
const assert = require('assert') | |
const ENCODERS = { | |
raw(len) { | |
return function(v) { | |
assert(v instanceof Buffer) | |
const buffer = Buffer.alloc(len) | |
v.copy(buffer) | |
return buffer |
#include <stdio.h> | |
#include <stdlib.h> | |
#define CHAR2INT(x) (('0' <= x && x <= '9') ? \ | |
(x - '0') : \ | |
(('a' <= x && x <= 'f') ? \ | |
(10 + (x - 'a')) : \ | |
(('A' <= x && x <= 'F') ? (10 + (x - 'A')) : (0)))) | |
#define UUID2ARRAY(uuid) { \ |