This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setFormValues(inputTxt) { | |
// var inputTxt = "CREATE CATALOG mysql_catalog WITH (connector = 'mysql',connection-url = 'jdbc:mysql://your-mysql-host:3306/database_name',connection-user = 'your_username',connection-password = 'your_password');"; | |
var regex = /([a-zA-Z-]+)\s*=\s*'([^']*)'/g; | |
for (const match of inputTxt.matchAll(regex)) { | |
console.log(`${match[1]} ${match[2]}`); | |
var key = match[1]; | |
var val = match[2]; | |
if (document.getElementById(key)) { |