Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Similar to this question, but not sure how to implement in this case.

A trusted user (don't need to be concerned with validating input) is typing/pasting email addresses into a text field. On the blur event, I'd like to look at the text and clean up whatever he inputed (typically after copying and pasting a list of addresses from an email client).

"Bob Smith" <bob@company.com>, joe@company.com, "John Doe"<john@company.com>

would be trimmed to:

bob@company.com, joe@company.com, john@company.com

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
790 views
Welcome To Ask or Share your Answers For Others

1 Answer

This regex should remove anything in double-quotes as well as < and > characters.

/".*?"|[<>]/

In Javascript, you might have something along these lines:

line.replace(/".*?"|[<>]/g, '');

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...