Skip to content

Instantly share code, notes, and snippets.

@AllanGraves
Created January 19, 2021 16:58
Show Gist options
  • Save AllanGraves/5e78d5ea0153ddfb13c6f9959cbc3513 to your computer and use it in GitHub Desktop.
Save AllanGraves/5e78d5ea0153ddfb13c6f9959cbc3513 to your computer and use it in GitHub Desktop.
regexifyString example
const result = regexifyString({
pattern: /{var .*}/gim,
decorator: (match, index) => {
console.log(match);
let textToDisplay = match.slice(4, -1);
return <VarInput inputText={textToDisplay} key={index} />;
},
input: text,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment