Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
function solve() { let inp = document.getElementById("array").value; let resultDiv = document.getElementById("result"); let splitPoint = inp.indexOf(", ")-1 ; let keyWord = inp.substring(2, splitPoint); let msg = inp.substring(splitPoint + 5, inp.length - 2) let messagepatt = new RegExp(`${keyWord}(\\s)+([A-Z!%\\$#]){8,}(\\s|\\.|,$)+`, "gmi"); while ((result = messagepatt.exec(msg)) !== null) { let tp = result[0].split(" "); if (tp[1] === tp[1].toUpperCase()) { let wordToDecode = tp[1]; while (tp[1].includes("!")) { tp[1] = tp[1].replace("!", "1") } while (tp[1].includes("%")) { tp[1] = tp[1].replace("%", "2") } while (tp[1].includes("#")) { tp[1] = tp[1].replace("#", "3") } while (tp[1].includes("$")) { tp[1] = tp[1].replace("$", "4") } msg = msg.replace(wordToDecode, tp[1].toLowerCase()) } } let separators = /(\.|\?)\s/gm; let arr = msg.split(separators); let ps=[]; for (let i = 0; i < arr.length; i += 2) { let newP = document.createElement("p"); let phrase=arr[i] + arr[i + 1]; if (phrase!==undefined) ps.push(phrase); } ps.forEach(p=>{ let np=document.createElement("p"); np.textContent=p; resultDiv.appendChild(np) }) console.log(resultDiv.children[0].textContent) console.log(resultDiv.children[1].textContent) console.log(resultDiv.children[2].textContent) }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)