Skip to content

Instantly share code, notes, and snippets.

Last active July 8, 2020 22:48
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
<meta charset="utf-8">
#entree {
width: 100%;
height: 300px;
#regex {
width: 100%;
function testRegex () {
const regexText = document.querySelector("#regex").value
const content = document.querySelector("#entree").value.split('\n')
const resultat = document.querySelector("#resultat")
const regex = new RegExp(regexText);
console.log('regex', regex);
console.log('content', content);
const output = => c.match(regex))
console.log('result', output);
resultat.textContent = JSON.stringify(output, null, 2);
<textarea id="entree"></textarea>
<input type="text" id="regex">
<button onclick="testRegex()">Tester la regex</button>
<pre id="resultat"></pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment