-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemp.js
61 lines (49 loc) · 1.25 KB
/
temp.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
fs = require('fs');
iconv = require('iconv-lite');
util = require('util');
/*
var files = [];
for (var i = 3; i < process.argv.length; i=i+2){
var map = {};
map.fn = process.argv[i-1];
map.enc = process.argv[i];
files.push(map);
}
console.log(util.inspect(files));
)/
/*
var str = "Dialogue: Marked=0,0:01:34.56,0:01:38.32,Default,NTP,0000,0000,0000,!Effect,第二話\N小鬼武士 小偷門生";
var re = /^Dialogue: Marked=0,([0-9]+):([0-9]+):([0-9]+).([0-9]+),[0-9]+:[0-9]+:[0-9]+.[0-9]+,[^,]+,[^,]+,[^,]+,[^,]+,[^,]+,[^,]+,(.*)$/;
var result = re.exec(str);
console.log(util.inspect(re, {showHidden: false, depth: null}));
console.log(util.inspect(result, {showHidden: false, depth: null}));
*/
/*
str = "fjoeiwjfoiwjef{fjeowijfoiwejf{fewoeifjoweifj}{{{eoiwjef}}}}owiejfoiwejf";
console.log(str + '\n' + RemoveCurlyBrace(str));
function RemoveCurlyBrace(s){
var out = [];
var count = 0;
for (var i =0; i < s.length ; i++){
console.log(s[i] + ' ' + count);
if (s[i] == "{") {
count++;
}
else if (s[i] == "}"){
if(count > 0) {
count--;
}
else {
count = 0;
}
}
else {
if(count == 0) {
out.push(s[i]);
}
}
}
return out.join('');
}
*/
//fs.appendFile('message.txt', 'data to append', function (err) {});