You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
274 B
10 lines
274 B
7 years ago
|
import { urlRegex } from './url_regex';
|
||
|
|
||
|
const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
|
||
|
|
||
|
export function countableText(inputText) {
|
||
|
return inputText
|
||
|
.replace(urlRegex, urlPlaceholder)
|
||
|
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
|
||
|
};
|