|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regular expression help...Hope that you can help me here. What the regualr expression for: any amount of non-digit characters follwed by some digits (and perhaps a letter or 2 after this) - that is strings found in address numbers especially in apartment numbers like, for example: #23 apt. 34 No.21A Any help on this much appreciated. Thank you, Al. "almu***@altavista.com" <almu***@altavista.com> wrote in [^0-9]*[0-9]*[A-Za-z]{,2}news:1144247834.657653.69760@i39g2000cwa.googlegroups.com: > any amount of non-digit characters follwed by some digits (and perhaps > a letter or 2 after this) - that is strings found in address numbers > especially in apartment numbers Tim F I tried my hand at this and here is what I came up with:
^\D+\d+[A-Za-z]? If only I could test these... Hi,
>> If only I could test these <http://regexlib.com/RETester.aspx>In my opinion, Regexes are only useful if you can very definitely constrain the sample strings you might receive. Although the suggested regexes might work (didn't test them), I would advise you to spare the some thought to what anomalous address formats you might receive. If the 3 examples you gave are the only possibilites, it would be good. But as I read in good book sometime back : "All input is Evil !". In other words, your users might enter text that you couldn't have imagined in your wildest dreams. ;-) Just my thoughts, Regards, Cerebrus.
Try catch and Resume
Installer Project - Conditions on Custom Action How to "append" a datatable? Insert into database Running program in VB.NET doesn't work? Creating a Help System Read-only collection... Content of Datagridview to Excel One line of code not working : susposed to resize datagrid column.. breakpoint will not currently be bit ??? |
|||||||||||||||||||||||