Answer the question
In order to leave comments, you need to log in
How to find all characters after a dot?
Goodnight. I need to remove all characters after the dot, I tried like this:
text.replace(/\.*\*/, "");
// И вот так
text.replace(/\.*\./, "");
Answer the question
In order to leave comments, you need to log in
Perhaps it's time to write an article on Habr about the harmfulness of RegExp. Your misunderstanding of what happens in the simplest regular season only proves it. And I will answer you, like many others before you, that you do not need RegExp, because it is very expensive, both in calculation and in support.
I need to remove all characters after the dot
const p = text.indexOf('.');
const result = p === -1 ? text : text.slice(0, p);
console.log(result);
tried like this:text.replace(/\[.][A-Z]/, "");
This regular expression will find the first dot immediately followed by a capital Latin letter and cut out only this particular combination, which does not correspond to the question at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question