-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp2.js
25 lines (25 loc) · 789 Bytes
/
app2.js
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
Object.prototype.copy = function () {
return JSON.parse(JSON.stringify(this))
};
Array.prototype.next = function () {
if(this.length == 0) return null
return this.splice(0,1)[0]
};
var file;
//REGEX
var rinteger = '([^((A-Z)\,)][0-9]+[^\,^\;^\)])'
var rfloat = '('+rinteger+'\,'+rinteger+')'
var rnumber = '('+rinteger+'|'+rfloat+')'
var rspecial = '(\(|\)|\;|\,|\.|(\=\:))'
//REGEX
var filename = process.argv[2];
var fs = require('fs');
fs.readFile(filename, 'utf8', function(err, data) {
if (err) throw err;
var fileData = data.toUpperCase();
console.log(fileData.match(new RegExp(rinteger, 'gi')));
//console.log(fileData.match(new RegExp(rfloat)));
//console.log(fileData.match(new RegExp(rnumber)));
//console.log(fileData.match(new RegExp(rspecial)));
return
})