1
I need a regex that takes cases that have number in the address name and also normal address. The Number always ends after the address.
Example: R 25 March 200.
I need the address that would be: R 25 March
And address number: 200
Regex regex = new Regex(@"\D+");
match = regex.Match("R 25 de março 200");
if (match.Success) {
string endereco = match.Value;
}
Why -1? I would like to know why.
– L. Falousk
What is the default? the address will always end with the house number?
– JuniorNunes
Yeah, it always ends with a house number.
– L. Falousk
Already tried to split by white space and catch the last occurrence?
– M. Bertolazo
No, M. Bertolazo, I need in regex even.
– L. Falousk
Put a $ at the end of your regex and see if that’s what you want:
new Regex(@"\D+$");
– JuniorNunes