%a | Abbreviated weekday name |
%A | Full weekday name |
%b | Abbreviated month name |
%B | Full month name |
%d | Day of month as decimal number (01..31) |
%H | Hour in 24-hour format (00..23) |
%j | Day of year as decimal number (001..366) |
%m | Month as decimal number (01..12) |
%M | Minute as decimal number (00..59) |
%S | Second (00..59) or second with decimals (dataParse, wdatef, 00.000000 .. 59.999999) |
%S. | Second with milliseconds (strdate only) |
%t | Unix time stamp in seconds, milliseconds, or microseconds since 1/1/1970 (dataParse, wdatef) |
%U | Week of year as decimal number, with Sunday as first day of week (00..53) |
%W | Week of year as decimal number, with Monday as first day of week (00..53) |
%y | Year without century, as decimal number (00..99) |
%Y | Year with century, as decimal number (1900..2999) |
%% | Percent sign |
The DATE format is equivalent to a double / var variable and counts the number of days since 12-31-1899 with a resolution of 1 µsec.
Format specifiers: | |
%c | ANSI character (int, char) |
%d | Decimal number (int, char) |
%e | Exponential floating-point number (var, double) |
%f | Floating-point number (var, double) |
%g | Either %e or %f, whichever is more compact |
%i | Decimal number (int, char) |
%o | Octal number (int, char) |
%p | Hexadecimal pointer (void*) |
%s | Null-terminated text (string, char*, char[]) |
%u | Unsigned decimal number (int, char) |
%x | Hexadecimal number (int, char), lowercase |
%X | Hexadecimal number (int, char), uppercase |
%% | Percent sign |
Format modifiers (optional, after the %) : | |
n | Field width, minimum number of digits. |
.m | Precision, maximum number of digits after the decimal. |
- | Left align the result within the given field width. |
+ | Prefix the output value with a sign (+ or –). |
0 | Add zeros until the number of digits is reached. |
' ' | Add a blank ' ' if the output value is signed and positive. |
Special characters | |
\a | Audible alert |
\b | Backspace |
\f | Form feed |
\n | New line, or linefeed |
\r | Carriage return |
\t | Tab |
\v | Vertical tab |
\\ | Backslash |
#... | Print to log only |
Code | Matches | Example |
* |
Preceding item zero or more times; like {0,}. |
zo* matches "z" and "zoo". |
+ |
Preceding item one or more times; like {1,}. |
zo+ matches "zo" and "zoo", but not "z". |
? |
Preceding item zero or one time; like {0,1}. |
zo? matches "z" and "zo", but not "zoo". |
^ |
The position at string start. |
^\d{3} matches 3 numeric digits at the start of the searched string. |
$ |
The position at string end. |
\d{3}$ matches 3 numeric digits at the end of the searched string. |
. |
Any single character except newline \n. |
a.c matches "abc", "a1c", and "a-c". |
| |
Choice between two or more items. |
z|food matches "z" or "food". (z|f)ood matches "zood" or "food". |
\* | The * character; similar with \+, \?, \., \[, \(, etc. | |
\b |
Word boundary. |
er\b matches the "er" in "never" but not the "er" in "verb". |
\B |
Word non-boundary. |
er\B matches the "er" in "verb" but not the "er" in "never". |
\d |
Digit character; equivalent to [0-9]. |
In "12 345", \d{2} matches "12" and "34". \d matches "1", 2", "3", "4", "5". |
\D |
Nondigit character; equivalent to [^0-9]. |
\D+ matches "abc" and " def" in "abc123 def". |
\s | Any white-space character; like [ \f\n\r\t\v]. | |
\S | Any non-white-space character; like [^ \f\n\r\t\v]. | |
\w |
A-Z, a-z, 0-9, and underscore, like [A-Za-z0-9_]. |
In "The quick brown fox…", \w+ matches "The", "quick", "brown", "fox". |
\W |
Any character except A-Z, a-z, 0-9, underscore. |
In "The quick brown fox…", \W+ matches "…" and all of the spaces. |
() |
Start and end of a subexpression. |
A(\d) matches "A0" to "A9". (f|b)*oo matches foo, boo, and oo. |
[abc] |
A character set; matches any specified character. |
[abc] matches the "a" in "plain". |
[^abc] |
Negative character set; any not specified character. |
[^abc] matches the "p", "l", "i", and "n" in "plain". |
[a-z] |
A range of characters; any character in the range. |
[a-z] matches any lowercase character in the range "a" through "z". |
[^a-z] |
Negative range; any character not in the range. |
[^a-z] matches any character that is not in the range "a" through "z". |
[a,b] |
All items separated with commas. |
[a-z,-] matches all characters in "my-file". |
{n} |
Preceding item exactly n times. |
o{2} does not match the "o" in "Bob", but the two "o"s in "food". |
{n,} |
Preceding item at least n times. |
o{2,} does not match the "o" in "Bob" but all the "o"s in "foooood". |
{n,m} |
Preceding item at least n and at most m times. |
In "1234567", \d{1,3} matches "123", "456", and "7". |
\cx |
The control character indicated by x. |
\cM matches a CTRL+M or carriage return character. |
\xnn |
A 2 digits hexadecimal character. |
\x41 matches "A". (\x041 is wrong!) |
\unnnn |
A 4 digits Unicode character. |
\u00A9 matches the copyright symbol (©). |
32 | [ ] | 33 | ! | 34 | " | 35 | # | 36 | $ | 37 | % | 38 | & | 39 | ' |
40 | ( | 41 | ) | 42 | * | 43 | + | 44 | , | 45 | - | 46 | . | 47 | / |
48 | 0 | 49 | 1 | 50 | 2 | 51 | 3 | 52 | 4 | 53 | 5 | 54 | 6 | 55 | 7 |
56 | 8 | 57 | 9 | 58 | : | 59 | ; | 60 | < | 61 | = | 62 | > | 63 | ? |
64 | @ | 65 | A | 66 | B | 67 | C | 68 | D | 69 | E | 70 | F | 71 | G |
72 | H | 73 | I | 74 | J | 75 | K | 76 | L | 77 | M | 78 | N | 79 | O |
80 | P | 81 | Q | 82 | R | 83 | S | 84 | T | 85 | U | 86 | V | 87 | W |
88 | X | 89 | Y | 90 | Z | 91 | [ | 92 | \ | 93 | ] | 94 | ^ | 95 | _ |
96 | ` | 97 | a | 98 | b | 99 | c | 100 | d | 101 | e | 102 | f | 103 | g |
104 | h | 105 | i | 106 | j | 107 | k | 108 | l | 109 | m | 110 | n | 111 | o |
112 | p | 113 | q | 114 | r | 115 | s | 116 | t | 117 | u | 118 | v | 119 | w |
120 | x | 121 | y | 122 | z | 123 | { | 124 | | | 125 | } | 126 | ~ | 127 | |
128 | € | 129 | • | 130 | ‚ | 131 | ƒ | 132 | „ | 133 | … | 134 | † | 135 | ‡ |
136 | ˆ | 137 | ‰ | 138 | Š | 139 | ‹ | 140 | Œ | 141 | 142 | Ţ | 143 | ||
144 | • | 145 | Ř | 146 | ř | 147 | Ŗ | 148 | ŗ | 149 | • | 150 | Ŕ | 151 | ŕ |
152 | ˜ | 153 | ™ | 154 | š | 155 | › | 156 | œ | 157 | • | 158 | ţ | 159 | Ÿ |
160 | 161 | ¡ | 162 | ¢ | 163 | £ | 164 | ¤ | 165 | ¥ | 166 | ¦ | 167 | § | |
168 | ¨ | 169 | © | 170 | ª | 171 | « | 172 | ¬ | 173 | 174 | ® | 175 | ¯ | |
176 | ° | 177 | ± | 178 | ² | 179 | ³ | 180 | ´ | 181 | µ | 182 | ¶ | 183 | · |
184 | ¸ | 185 | ¹ | 186 | º | 187 | » | 188 | ¼ | 189 | ½ | 190 | ¾ | 191 | ¿ |
192 | À | 193 | 194 | Â | 195 | Ã | 196 | Ä | 197 | Å | 198 | Æ | 199 | Ç | |
200 | È | 201 | É | 202 | Ê | 203 | Ë | 204 | Ì | 205 | 206 | Î | 207 | ||
208 | �? | 209 | Ñ | 210 | Ò | 211 | Ó | 212 | Ô | 213 | Õ | 214 | Ö | 215 | × |
216 | Ø | 217 | Ù | 218 | Ú | 219 | Û | 220 | Ü | 221 | 222 | Þ | 223 | ß | |
224 | à | 225 | á | 226 | â | 227 | ã | 228 | ä | 229 | å | 230 | æ | 231 | ç |
232 | è | 233 | é | 234 | ê | 235 | ë | 236 | ì | 237 | í | 238 | î | 239 | ï |
240 | ð | 241 | ñ | 242 | ò | 243 | ó | 244 | ô | 245 | õ | 246 | ö | 247 | ÷ |
248 | ø | 249 | ù | 250 | ú | 251 | û | 252 | ü | 253 | ý | 254 | þ | 255 | ÿ |