8
What I need to do is this: let’s assume that the string is -> :
.
However I want to select "only" the string before the :
using the Regex
.
To make it clearer:
"select that word: another word here"
Recalling that the :
should not be selected.
Try to use this: ^(.*?):
– Fernando Souza
@Fernando Has how to do this before the -> (:) ??
– sYsTeM
Yes, another alternative is to use Match result = Regex.Match(text, @" .*?(?=:)"); in which case regex will take everything down to the first (:)
– Fernando Souza
@Sérgiohenrique You can always choose one (and only one) correct answer to your questions. You mark an answer as correct using the ✓ on the left side of the response.
– Jéf Bueno