J
Jianwei Sun
Hi, guys,
I am trying to parse out the apratment number in a regular expression :
If I use
Regex regex = new
Regex(@"(?<AddressWithoutApartment>.+)(?<ApartmentSeperator>\bAPT|#|UNIT\b)(?<Apartment>.+)",
RegexOptions.ExplicitCapture);
I will be able to parse out "100 main ST # C)
But if I move "#" position in regular expression, I won't be able to
parse out the same address anymore.
Regex regex = new
Regex(@"(?<AddressWithoutApartment>.+)(?<ApartmentSeperator>\bAPT|UNIT\#\b)(?<Apartment>.+)",
RegexOptions.ExplicitCapture);
Any suggestion, guru.
Thanks,
JW
I am trying to parse out the apratment number in a regular expression :
If I use
Regex regex = new
Regex(@"(?<AddressWithoutApartment>.+)(?<ApartmentSeperator>\bAPT|#|UNIT\b)(?<Apartment>.+)",
RegexOptions.ExplicitCapture);
I will be able to parse out "100 main ST # C)
But if I move "#" position in regular expression, I won't be able to
parse out the same address anymore.
Regex regex = new
Regex(@"(?<AddressWithoutApartment>.+)(?<ApartmentSeperator>\bAPT|UNIT\#\b)(?<Apartment>.+)",
RegexOptions.ExplicitCapture);
Any suggestion, guru.
Thanks,
JW