var str = "MID_支援会話_アルム_エフィ_C: $t1$Wmアルム|"+
"7$w0|$Wmエフィ|3$w0|$Wsエフィ|$Wa$SvpV_RELIANCE_ARUM_EFI_C_00|"+
"There you are, Alm!$k\n$Wsアルム|$Wa$SvpV_RELIANCE_ARUM_EFI_C_01|"+
"Hello, Faye. How's it going?$k\n$Wsエフィ|$Wa$SvpV_RELIANCE_ARUM_EFI_C_02|"+
"$E笑,|I'm doing just fine now.$k$p$SvpV_RELIANCE_ARUM_EFI_C_03|"+
"Seeing your face is always a bright\nspot in my day.$k\n$Wsアルム|"+
"$Wa$SvpV_RELIANCE_ARUM_EFI_C_04|$E笑,|"+
"Heh. Well, I'm glad it's not a low point.$k";
var re = /([^|]*?)(?:\$k)/g;
var result;
while ((result = re.exec(str)) !== null) {
console.log(result[1]);
}
function nod(m, n) {
var mult = 0;
while (true) {
if (0 == m) {
return n << mult;
}
if (0 == n) {
return m << mult;
}
if (1 == m || 1 == n) {
return 1 << mult;
}
if (m == n) {
return m << mult;
}
if (0 == (m & 1) && 0 == (n & 1)) {
mult++;
m >>= 1;
n >>= 1;
} else if (0 == (m & 1)) {
m >>= 1;
} else if (0 == (n & 1)) {
n >>= 1;
} else if (m > n) {
m = (m-n) >> 1;
} else {
n = (n-m) >> 1;
}
}
}
function reduceFrac(numerator, denomerator) {
var divider = nod(numerator, denomerator);
return {n: numerator/divider, d: denomerator/divider};
}
2·x + 3·y - z = 0
4·x + 6·y -2·z = 0
3·x - y + 2·z = 0
x + 3/2·y - 1/2·z = 0
0 = 0
- 11/2·y + 7/2·z = 0
y = 7/11·z
x = -5/11·z
x + y + z = -5/11·z + 7/11·z + z = 13/11·z <= 1
x + y + z = 13/11·z -> max