debian-mirror-gitlab/app/assets/javascripts/jobs/utils.js
2021-09-30 23:02:18 +05:30

12 lines
380 B
JavaScript

/**
* capture anything starting with http:// or https://
* https?:\/\/
*
* up until a disallowed character or whitespace
* [^"<>()\\^`{|}\s]+
*
* and a disallowed character or whitespace, including non-ending chars .,:;!?
* [^"<>()\\^`{|}\s.,:;!?]
*/
export const linkRegex = /(https?:\/\/[^"<>()\\^`{|}\s]+[^"<>()\\^`{|}\s.,:;!?])/g;
export default { linkRegex };