I have a regex pattern that detects the whole pattern, that is, asterisks along with the text in between.
Pattern: (\*|__)(.*?)\1
I want it to only match the asterisks, when the words are present in between. Example:
*This is one* This is some other text *New word* Another text another* and there is some more text
- Asterisks of
This is oneshould be detected; - Asterisks of
New wordshould be detected; - Last asterisk shouldn't be detected, as it doesn't have any closing one.
I tried several ways, but couldn't find a way, in which the middle words are not detected and only the asterisk.
Programming Language: Typescript (Angular)
Example 2:
*Project Name:* This is some other text *New word* Another text another and there is some more text