Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Answer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Homework 2: Write regex that match all words
2.1 Have 5 characters
2.2 Not start with a, b, e, k
2.3 Second character is not g, m, k, b
2.4 Fourth character is f
2.5 End with e

[^abek][^gmkb]\wfe


Homework 3: Write regex that match all words
3.1 Start with c but the next char is not h
3.2 End with te

c[^h]\w*te


Homework 4: Write regex that match all words
4.1 Have either sign or ect or sis
4.2 Not end with xt, de, me

.*(sign|ect|sis).*(?<!xt|de|me)


Homework 5: Write regex that match all words
5.1 Do not have trac
^((?!trac).)*$
7 changes: 7 additions & 0 deletions Homework_1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
text=File.open("data.txt").read
regex = /^\|\s*(\d*)?\s*\|\s*(.+)?\s*\|\s*\d*\s*\|\s*\d*-(\d*)?/
File.write("result.txt", "")
text.each_line do |line|
match_words = line.match(regex).to_a
File.write("result.txt", match_words[1] + "|" + match_words[2].gsub(/\s+$/,"") + "|" + match_words[3] + "\n", mode: "a") unless match_words.empty?
end
150 changes: 150 additions & 0 deletions data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
+-----+------------------------------------+-------------+---------------------+------------+
| id | name | category_id | created_at | updated_at |
+-----+------------------------------------+-------------+---------------------+------------+
| 1 | C | 11 | 2017-07-20 14:46:17 | NULL |
| 2 | C# | 11 | 2017-07-20 14:46:17 | NULL |
| 3 | C++ | 11 | 2017-07-20 14:46:17 | NULL |
| 4 | Clojure | 11 | 2017-07-20 14:46:17 | NULL |
| 5 | COBOL | 11 | 2017-07-20 14:46:17 | NULL |
| 6 | Dart | 11 | 2017-07-20 14:46:17 | NULL |
| 7 | Delphi | 11 | 2017-07-20 14:46:17 | NULL |
| 8 | Elixir | 11 | 2017-07-20 14:46:17 | NULL |
| 9 | Elm | 11 | 2017-07-20 14:46:17 | NULL |
| 10 | Erlang | 11 | 2017-07-20 14:46:17 | NULL |
| 11 | Hack | 11 | 2017-07-20 14:46:17 | NULL |
| 12 | Haskell | 11 | 2017-07-20 14:46:17 | NULL |
| 13 | Go | 11 | 2017-07-20 14:46:17 | NULL |
| 14 | Java | 11 | 2017-07-20 14:46:17 | NULL |
| 15 | JavaScript | 11 | 2017-07-20 14:46:17 | NULL |
| 16 | Kotlin | 11 | 2017-07-20 14:46:17 | NULL |
| 17 | Lua | 11 | 2017-07-20 14:46:17 | NULL |
| 18 | Objective-C | 11 | 2017-07-20 14:46:17 | NULL |
| 19 | Perl | 11 | 2017-07-20 14:46:17 | NULL |
| 20 | PHP | 11 | 2017-07-20 14:46:17 | NULL |
| 21 | Python | 11 | 2017-07-20 14:46:17 | NULL |
| 22 | R | 11 | 2017-07-20 14:46:17 | NULL |
| 23 | Ruby | 11 | 2017-07-20 14:46:17 | NULL |
| 24 | Rust | 11 | 2017-07-20 14:46:17 | NULL |
| 25 | Scala | 11 | 2017-07-20 14:46:17 | NULL |
| 26 | Swift | 11 | 2017-07-20 14:46:17 | NULL |
| 27 | TypeScript | 11 | 2017-07-20 14:46:17 | NULL |
| 28 | Visual Basic | 11 | 2017-07-20 14:46:17 | NULL |
| 29 | HTML | 7 | 2017-07-20 14:46:17 | NULL |
| 30 | CSS | 7 | 2017-07-20 14:46:17 | NULL |
| 31 | XML | 7 | 2017-07-20 14:46:17 | NULL |
| 32 | Android | 9 | 2017-07-20 14:46:17 | NULL |
| 33 | iOS | 9 | 2017-07-20 14:46:17 | NULL |
| 34 | MacOS | 9 | 2017-07-20 14:46:17 | NULL |
| 35 | UNIX/Linux | 9 | 2017-07-20 14:46:17 | NULL |
| 36 | Windows | 9 | 2017-07-20 14:46:17 | NULL |
| 37 | .net framework | 4 | 2017-07-20 14:46:17 | NULL |
| 38 | AngularJS | 4 | 2017-07-20 14:46:17 | NULL |
| 39 | CakePHP | 4 | 2017-07-20 14:46:17 | NULL |
| 40 | Cocos2d | 4 | 2017-07-20 14:46:17 | NULL |
| 41 | Django | 4 | 2017-07-20 14:46:17 | NULL |
| 42 | Hadoop | 4 | 2017-07-20 14:46:17 | NULL |
| 43 | Hanami | 4 | 2017-07-20 14:46:17 | NULL |
| 44 | jQuery | 4 | 2017-07-20 14:46:17 | NULL |
| 45 | Laravel | 4 | 2017-07-20 14:46:17 | NULL |
| 46 | Node.js | 4 | 2017-07-20 14:46:17 | NULL |
| 47 | Phalcon | 4 | 2017-07-20 14:46:17 | NULL |
| 48 | Phoenix | 4 | 2017-07-20 14:46:17 | NULL |
| 49 | Play | 4 | 2017-07-20 14:46:17 | NULL |
| 50 | Rails | 4 | 2017-07-20 14:46:17 | NULL |
| 51 | React.js | 4 | 2017-07-20 14:46:17 | NULL |
| 52 | RxJS | 4 | 2017-07-20 14:46:17 | NULL |
| 53 | Sails.js | 4 | 2017-07-20 14:46:17 | NULL |
| 54 | Sinatra | 4 | 2017-07-20 14:46:17 | NULL |
| 55 | Spring | 4 | 2017-07-20 14:46:17 | NULL |
| 56 | Struts | 4 | 2017-07-20 14:46:17 | NULL |
| 57 | Symfony | 4 | 2017-07-20 14:46:17 | NULL |
| 58 | Unity | 4 | 2017-07-20 14:46:17 | NULL |
| 59 | Vue.js | 4 | 2017-07-20 14:46:17 | NULL |
| 60 | web2py | 4 | 2017-07-20 14:46:17 | NULL |
| 61 | Wicket | 4 | 2017-07-20 14:46:17 | NULL |
| 62 | Xamarin | 4 | 2017-07-20 14:46:17 | NULL |
| 63 | Yii | 4 | 2017-07-20 14:46:17 | NULL |
| 64 | Zend Framework | 4 | 2017-07-20 14:46:17 | NULL |
| 65 | Apache | 14 | 2017-07-20 14:46:17 | NULL |
| 66 | IIS | 14 | 2017-07-20 14:46:17 | NULL |
| 67 | Jigsaw | 14 | 2017-07-20 14:46:17 | NULL |
| 68 | lighttpd | 14 | 2017-07-20 14:46:17 | NULL |
| 69 | Mongrel | 14 | 2017-07-20 14:46:17 | NULL |
| 70 | Nginx | 14 | 2017-07-20 14:46:17 | NULL |
| 71 | Passenger | 14 | 2017-07-20 14:46:17 | NULL |
| 72 | Puma | 14 | 2017-07-20 14:46:17 | NULL |
| 73 | Tomcat | 14 | 2017-07-20 14:46:17 | NULL |
| 74 | Unicorn | 14 | 2017-07-20 14:46:17 | NULL |
| 75 | Cassandra | 12 | 2017-07-20 14:46:17 | NULL |
| 76 | DB2 | 12 | 2017-07-20 14:46:17 | NULL |
| 77 | DynamoDB | 12 | 2017-07-20 14:46:17 | NULL |
| 78 | HBase | 12 | 2017-07-20 14:46:17 | NULL |
| 79 | Memcached | 12 | 2017-07-20 14:46:17 | NULL |
| 80 | MongoDB | 12 | 2017-07-20 14:46:17 | NULL |
| 81 | MySQL | 12 | 2017-07-20 14:46:17 | NULL |
| 82 | Oracle | 12 | 2017-07-20 14:46:17 | NULL |
| 83 | PostgreSQL | 12 | 2017-07-20 14:46:17 | NULL |
| 84 | Redis | 12 | 2017-07-20 14:46:17 | NULL |
| 85 | SQL Server | 12 | 2017-07-20 14:46:17 | NULL |
| 86 | SQLite | 12 | 2017-07-20 14:46:17 | NULL |
| 87 | ElasticSearch | 5 | 2017-07-20 14:46:17 | NULL |
| 88 | Lucene | 5 | 2017-07-20 14:46:17 | NULL |
| 89 | Solr | 5 | 2017-07-20 14:46:17 | NULL |
| 90 | Amazon Web Services | 10 | 2017-07-20 14:46:17 | NULL |
| 91 | Cloud Foundry | 10 | 2017-07-20 14:46:17 | NULL |
| 92 | Deis | 10 | 2017-07-20 14:46:17 | NULL |
| 93 | Docker | 10 | 2017-07-20 14:46:17 | NULL |
| 94 | Dokku | 10 | 2017-07-20 14:46:17 | NULL |
| 95 | Engine Yard | 10 | 2017-07-20 14:46:17 | NULL |
| 96 | Firebase | 10 | 2017-07-20 14:46:17 | NULL |
| 97 | Google Cloud Platform | 10 | 2017-07-20 14:46:17 | NULL |
| 98 | Heroku | 10 | 2017-07-20 14:46:17 | NULL |
| 99 | IBM Bluemix | 10 | 2017-07-20 14:46:17 | NULL |
| 100 | Microsoft Azure | 10 | 2017-07-20 14:46:17 | NULL |
| 101 | On-premises | 10 | 2017-07-20 14:46:17 | NULL |
| 102 | OpenShift | 10 | 2017-07-20 14:46:17 | NULL |
| 103 | OpenStack | 10 | 2017-07-20 14:46:17 | NULL |
| 104 | Bash | 13 | 2017-07-20 14:46:17 | NULL |
| 105 | Emacs | 13 | 2017-07-20 14:46:17 | NULL |
| 106 | Git | 13 | 2017-07-20 14:46:17 | NULL |
| 107 | MS-DOS Shell | 13 | 2017-07-20 14:46:17 | NULL |
| 108 | Subversion | 13 | 2017-07-20 14:46:17 | NULL |
| 109 | Vim | 13 | 2017-07-20 14:46:17 | NULL |
| 110 | zsh | 13 | 2017-07-20 14:46:17 | NULL |
| 111 | CircleCI | 1 | 2017-07-20 14:46:17 | NULL |
| 112 | Jenkins | 1 | 2017-07-20 14:46:17 | NULL |
| 113 | TravisCI | 1 | 2017-07-20 14:46:17 | NULL |
| 114 | Ansible | 8 | 2017-07-20 14:46:17 | NULL |
| 115 | kubernetes | 8 | 2017-07-20 14:46:17 | NULL |
| 116 | monit | 8 | 2017-07-20 14:46:17 | NULL |
| 117 | nagios | 8 | 2017-07-20 14:46:17 | NULL |
| 118 | puppet | 8 | 2017-07-20 14:46:17 | NULL |
| 119 | zabbix | 8 | 2017-07-20 14:46:17 | NULL |
| 120 | Backup and Recovery | 2 | 2017-07-20 14:46:17 | NULL |
| 121 | Data migration | 2 | 2017-07-20 14:46:17 | NULL |
| 122 | Database design and planning | 2 | 2017-07-20 14:46:17 | NULL |
| 123 | Database installation and upgrade | 2 | 2017-07-20 14:46:17 | NULL |
| 124 | Database redundancy | 2 | 2017-07-20 14:46:17 | NULL |
| 125 | Database relocation | 2 | 2017-07-20 14:46:17 | NULL |
| 126 | Performance tuning | 2 | 2017-07-20 14:46:17 | NULL |
| 127 | Security management | 2 | 2017-07-20 14:46:17 | NULL |
| 128 | Storage management | 2 | 2017-07-20 14:46:17 | NULL |
| 129 | Routing and Switching | 6 | 2017-07-20 14:46:17 | NULL |
| 130 | Security (Gateway, Firewall, etc) | 6 | 2017-07-20 14:46:17 | NULL |
| 131 | Server and Storage Infrastructure | 6 | 2017-07-20 14:46:17 | NULL |
| 132 | Server virtualization | 6 | 2017-07-20 14:46:17 | NULL |
| 133 | Agriculture & Forestry/Wildlife | 3 | 2017-07-20 14:46:17 | NULL |
| 134 | Business & Information | 3 | 2017-07-20 14:46:17 | NULL |
| 135 | Construction/Utilities/Contracting | 3 | 2017-07-20 14:46:17 | NULL |
| 136 | Education | 3 | 2017-07-20 14:46:17 | NULL |
| 137 | Finance & Insurance | 3 | 2017-07-20 14:46:17 | NULL |
| 138 | Food & Hospitality | 3 | 2017-07-20 14:46:17 | NULL |
| 139 | Gaming | 3 | 2017-07-20 14:46:17 | NULL |
| 140 | Health Services | 3 | 2017-07-20 14:46:17 | NULL |
| 141 | Motor Vehicle | 3 | 2017-07-20 14:46:17 | NULL |
| 142 | Natural Resources/Environmental | 3 | 2017-07-20 14:46:17 | NULL |
| 143 | Personal Services | 3 | 2017-07-20 14:46:17 | NULL |
| 144 | Real Estate & Housing | 3 | 2017-07-20 14:46:17 | NULL |
| 145 | Safety/Security & Legal | 3 | 2017-07-20 14:46:17 | NULL |
| 146 | Transportation | 3 | 2017-07-20 14:46:17 | NULL |
+-----+------------------------------------+-------------+---------------------+------------+
146 changes: 146 additions & 0 deletions result.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
1|C|07
2|C#|07
3|C++|07
4|Clojure|07
5|COBOL|07
6|Dart|07
7|Delphi|07
8|Elixir|07
9|Elm|07
10|Erlang|07
11|Hack|07
12|Haskell|07
13|Go|07
14|Java|07
15|JavaScript|07
16|Kotlin|07
17|Lua|07
18|Objective-C|07
19|Perl|07
20|PHP|07
21|Python|07
22|R|07
23|Ruby|07
24|Rust|07
25|Scala|07
26|Swift|07
27|TypeScript|07
28|Visual Basic|07
29|HTML|07
30|CSS|07
31|XML|07
32|Android|07
33|iOS|07
34|MacOS|07
35|UNIX/Linux|07
36|Windows|07
37|.net framework|07
38|AngularJS|07
39|CakePHP|07
40|Cocos2d|07
41|Django|07
42|Hadoop|07
43|Hanami|07
44|jQuery|07
45|Laravel|07
46|Node.js|07
47|Phalcon|07
48|Phoenix|07
49|Play|07
50|Rails|07
51|React.js|07
52|RxJS|07
53|Sails.js|07
54|Sinatra|07
55|Spring|07
56|Struts|07
57|Symfony|07
58|Unity|07
59|Vue.js|07
60|web2py|07
61|Wicket|07
62|Xamarin|07
63|Yii|07
64|Zend Framework|07
65|Apache|07
66|IIS|07
67|Jigsaw|07
68|lighttpd|07
69|Mongrel|07
70|Nginx|07
71|Passenger|07
72|Puma|07
73|Tomcat|07
74|Unicorn|07
75|Cassandra|07
76|DB2|07
77|DynamoDB|07
78|HBase|07
79|Memcached|07
80|MongoDB|07
81|MySQL|07
82|Oracle|07
83|PostgreSQL|07
84|Redis|07
85|SQL Server|07
86|SQLite|07
87|ElasticSearch|07
88|Lucene|07
89|Solr|07
90|Amazon Web Services|07
91|Cloud Foundry|07
92|Deis|07
93|Docker|07
94|Dokku|07
95|Engine Yard|07
96|Firebase|07
97|Google Cloud Platform|07
98|Heroku|07
99|IBM Bluemix|07
100|Microsoft Azure|07
101|On-premises|07
102|OpenShift|07
103|OpenStack|07
104|Bash|07
105|Emacs|07
106|Git|07
107|MS-DOS Shell|07
108|Subversion|07
109|Vim|07
110|zsh|07
111|CircleCI|07
112|Jenkins|07
113|TravisCI|07
114|Ansible|07
115|kubernetes|07
116|monit|07
117|nagios|07
118|puppet|07
119|zabbix|07
120|Backup and Recovery|07
121|Data migration|07
122|Database design and planning|07
123|Database installation and upgrade|07
124|Database redundancy|07
125|Database relocation|07
126|Performance tuning|07
127|Security management|07
128|Storage management|07
129|Routing and Switching|07
130|Security (Gateway, Firewall, etc)|07
131|Server and Storage Infrastructure|07
132|Server virtualization|07
133|Agriculture & Forestry/Wildlife|07
134|Business & Information|07
135|Construction/Utilities/Contracting|07
136|Education|07
137|Finance & Insurance|07
138|Food & Hospitality|07
139|Gaming|07
140|Health Services|07
141|Motor Vehicle|07
142|Natural Resources/Environmental|07
143|Personal Services|07
144|Real Estate & Housing|07
145|Safety/Security & Legal|07
146|Transportation|07