xxxxxxxxxx
var str = "Java Script Object Notation";
var matches = str.match(/\b(\w)/g); // ['J','S','O','N']
var acronym = matches.join(''); // JSON
console.log(acronym)
Run code snippet
xxxxxxxxxx
function validateEmail($email) {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
return emailReg.test( $email );
}
if( !validateEmail(emailaddress)) { /* do stuff here */ }
xxxxxxxxxx
import nltk
from nltk.corpus import stopwords
nltk.download('stopwords')
print(stopwords.words('english'))
xxxxxxxxxx
# if the name of the symbolic link is "sym-link", just type the below command to rmeove it
rm sym-link
xxxxxxxxxx
let str = "Java Script Object Notation";
let acronym = str.split(/\s/).reduce((response,word)=> response+=word.slice(0,1),'')
console.log(acronym);
Run code snippet