javascript - Extract special text type with imacros -
i eval code extract email address text, searching stackoverflow found code
var re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))/g;
extract email addresses bulk text using jquery likw know how create eval code function tried failed,
set !var1 eval("var re = /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))/g;")
so please in writing code. thanks
set teststring "bla bla bla xyz@mail.com bla bla bla" set email eval("'{{teststring}}'.match(/(([^<>()[\\]\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-za-z\\-0-9]+\\.)+[a-za-z]{2,}))/g)[0];") prompt {{email}}
Comments
Post a Comment