|
|
Browser Sizer
ASCII Character Chart
| 0 | NUL |
16 | DLE |
32 | SP |
48 | 0 |
64 | @ |
80 | P |
96 | ` |
112 | p |
| 1 | SOH |
17 | DC1 |
33 | ! |
49 | 1 |
65 | A |
81 | Q |
97 | a |
113 | q |
| 2 | STX |
18 | DC2 |
34 | " |
50 | 2 |
66 | B |
82 | R |
98 | b |
114 | r |
| 3 | ETX |
19 | DC3 |
35 | # |
51 | 3 |
67 | C |
83 | S |
99 | c |
115 | s |
| 4 | EOT |
20 | DC4 |
36 | $ |
52 | 4 |
68 | D |
84 | T |
100 | d |
116 | t |
| 5 | ENQ |
21 | NAK |
37 | % |
53 | 5 |
69 | E |
85 | U |
101 | e |
117 | u |
| 6 | ACK |
22 | SYN |
38 | & |
54 | 6 |
70 | F |
86 | V |
102 | f |
118 | v |
| 7 | BEL |
23 | ETB |
39 | ' |
55 | 7 |
71 | G |
87 | W |
103 | g |
119 | w |
| 8 | BS |
24 | CAN |
40 | ( |
56 | 8 |
72 | H |
88 | X |
104 | h |
120 | x |
| 9 | HT |
25 | EM |
41 | ) |
57 | 9 |
73 | I |
89 | Y |
105 | i |
121 | y |
| 10 | LF |
26 | SUB |
42 | * |
58 | : |
74 | J |
90 | Z |
106 | j |
122 | z |
| 11 | VT |
27 | ESC |
43 | + |
59 | ; |
75 | K |
91 | [ |
107 | k |
123 | { |
| 12 | FF |
28 | FS |
44 | , |
60 | < |
76 | L |
92 | \ |
108 | l |
124 | | |
| 13 | CR |
29 | GS |
45 | - |
61 | = |
77 | M |
93 | ] |
109 | m |
125 | } |
| 14 | SO |
30 | RS |
46 | . |
62 | > |
78 | N |
94 | ^ |
110 | n |
126 | ~ |
| 15 | SI |
31 | US |
47 | / |
63 | ? |
79 | O |
95 | _ |
111 | o |
127 | DEL |
ASCII Translate
Regular Expressions
Single Character - The following rules govern one-character RegExp that match a single character:
- Special characters are: + * ? . [ ] ^ $ ( ) { } | \ &
- Any character that is not a special character matches itself.
- Use the keyboard (Tab, Enter) to match whitespace characters.
- The asterisk (*) matches the specified characters throughout the entire document.
- The carat (^) matches the beginning of the document.
- The dollar sign ($) matches the end of the document.
- A backslash (\) followed by any special character matches the literal character itself; that is, the backslash escapes the special character.
- The pound sign (#) and hyphen (-) characters must be escaped in expressions (## --) just as though they were special characters.
- A period (.) matches any character, including a new line. To match any character except a new line, use [^#chr(13)##chr(10)#], which excludes the ASCII carriage return and line feed codes.
- A set of characters enclosed in brackets ([]) is a one-character RegExp that matches any of the characters in that set. For example, [akm] matches an a, k, or m. Note that if you want to include a closing square bracket (]) in square brackets, it must be the first character. Otherwise, it does not work, even if you use \].
- Any regular expression can be followed by one of the following suffixes:
- {m,n} forces a match of m through n (inclusive) occurrences of the preceding regular expression.
- {m,} forces a match of at least m occurrences of the preceding regular expression.
- The syntax {,n} is not allowed.
- A range of characters can be indicated with a dash. For example, [a-z] matches any lowercase letter. However, if the first character of the set is the caret (^), the RegExp matches any character except those in the set. It does not match the empty string. For example, [^akm] matches any character except a, k, or m. The caret loses its special meaning if it is not the first character of the set.
All regular expressions can be made case-insensitive by substituting individual characters with character sets, for example, [Nn][Ii][Cc][Kk].
Character Classes - You can specify a character by using a POSIX character class:
- [[:alpha:]] - Any letter, [A-Za-z]
- [[:upper:]] - Any uppercase letter, [A-Z]
- [[:lower:]] - Any lowercase letter, [a-z]
- [[:digit:]] - Any digit, [0-9]
- [[:alnum:]] - Any alphanumeric character, [A-Za-z0-9]
- [[:xdigit:]] - Any hexadecimal digit, [0-9A-Fa-f]
- [[:space:]] - A tab, new line, vertical tab, form feed, carriage return, or space
- [[:print:]] - Any printable character
- [[:punct:]] - Any punctuation character: ! ' # S % & ' ( ) * + , - . / : ; < = > ? @ [ / ] ^ _ { | } ~
- [[:graph:]] - Any character defined as a printable character except those defined as part of the space character class
- [[:cntrl:]] - Any character not part of the character classes: [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], [:print:], [:punct:], [:graph:]
Multi Character - The following rules govern multi-character regular expressions:
- Parentheses group parts of regular expressions together into grouped subexpressions that can be treated as a single unit. For example, (ha)+ matches one or more instances of "ha".
- A one-character regular expression or grouped subexpressions followed by an asterisk (*) matches zero or more occurrences of the regular expression. For example, [a-z]* matches zero or more lowercase characters.
- A one-character regular expression or grouped subexpressions followed by a plus (+) matches one or more occurrences of the regular expression. For example, [a-z]+ matches one or more lowercase characters.
- A one-character regular expression or grouped subexpressions followed by a question mark (?) matches zero or one occurrences of the regular expression. For example, xy?z matches either "xyz" or "xz".
- The concatenation of regular expressions creates a regular expression that matches the corresponding concatenation of strings. For example, [A-Z][a-z]* matches any word, regardless of case.
- The OR character (|) allows a choice between two regular expressions. For example, jell(y|ies) matches either "jelly" or "jellies".
- Braces ({}) are used to indicate a range of occurrences of a regular expression, in the form {m, n} where m is a positive integer equal to or greater than zero indicating the start of the range and n is equal to or greater than m, indicating the end of the range. For example, (ba){0,3} matches up to three pairs of the expression "ba".
Back Reference - Allows you to match text in previously matched sets of parentheses:
You can use a backslash followed by a digit n (\n) to refer to the nth parenthesized subexpression.
One example of how you can use back references is searching for doubled words, for example, to find instances of "is is" or "the the" in text. The following example shows the syntax you use for back referencing in regular expressions:
("There is is coffee in the the kitchen", "([A-Za-z]+)[ ]+\1", "*", "ALL")
This code searches for words that are all letters ([A-Za-z]+) followed by one or more spaces [ ]+ followed by the first matched subexpression in parentheses. The parser detects the two occurrences of is as well as the two occurrences of the and replaces them with an asterisk, resulting in the following text:
There * coffee in * kitchen
Anchoring - You can anchor all or part of a regular expression to either the beginning or end of the string being searched:
- If a caret (^) is at the beginning of a subexpression, the matched string must be at the beginning of the string being searched.
- If a dollar sign ($) is at the end of a subexpression, the matched string must be at the end of the string being searched.
|