forked from StevensDeptECE/CPE552-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregex.examples
More file actions
39 lines (29 loc) · 726 Bytes
/
regex.examples
File metadata and controls
39 lines (29 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
abc a followed by b followed by c
[abc] one of a or b or c
[a-z] one of the range a through z
[^abc] match any one letter that is NOT a or b or c
\d [0-9]
\w [a-zA-Z0-9]
a* zero or more occurrences of a nothing or a, aa, aaa, aaaaaaa ...
a+ aa* one or more
a? zero or one occurrence
(?:hello)+ non-grouping paren matches hello hellohello hellohellohello...
(?:abc|def) abc OR def
. any single character except \n
( ) grouping operator, remembers what was matched
a9 abc
ABC
ABC_123
ABC$123
[A-Za-z_][0-9A-Za-z_\$]*
A
A9
AB
aB
ABC
http://www.azz.com
http://azz.com
http://www.az.co.uk
.us .gov .biz .co.uk
https?:\/\/([a-zA-Z0-9]+\.)?[a-zA-Z0-9]+\.[a-zA-Z0-9]+
https://