How to make a c# regex match only the *last* occurrence of a pattern?
- From: "sherifffruitfly" <sherifffruitfly@xxxxxxxxx>
- Date: 8 Nov 2006 16:17:25 -0800
Hi,
I've been searching as best I can for this - coming up with little.
I have a file that is full of lines fitting this pattern:
(?<year>\d{4}),(?<amount>\d{6,7})
I'm likely to get a bunch of hits with this - I'm only interested in
the *last* one. Is there a way to build the concept "last" into the
regex itself? Or is taking the last element of the match array the only
thing to do?
I would just prefer to avoid have a potentially long array being sent
around...
Thanks,
cdj
.
- Follow-Ups:
- Prev by Date: Re: REALLY need help with SendMessage WM_GETCONTROLNAME
- Next by Date: Re: Method returns value error
- Previous by thread: How to fire an event
- Next by thread: Re: How to make a c# regex match only the *last* occurrence of a patte
- Index(es):