Experience in C++, C#, Java and Process : Living in Montreal

* What is my technical experience as a software developer

* What I have learned in the software business

* Where I am heading to in my career

* How to process in a project

Wednesday, January 26, 2005

Regular expression in C#

It is time consuming to build a regular expression.
I have a text file as below:

idnameaddressemailfaxpassowrd
example:
000010034981Mr. Ray BabsMontreal Canada Test@glinknet.com5142842903PassWord

How do I parse it? Note it is possible no value for address, email, fax, or password

Here is the regular expression I built ( 2 hours work)

(?\d+)\(?(.[^]+))\(?
()(.[^]+))\(?(.[^]+)())\(?()(.[^]+))\(?(.+()))

It retrives the value to groups defined by "?"
(? ()(.[^]+))

Can you find better expression?
Regex regx = new Regex( @"(?\d+)\(?(.[^]+))\(?
()(.[^]+))\(?(.[^]+)())\(?()(.[^]+))\(?(.+()))", RegexOptions.IgnoreCase RegexOptions.Singleline RegexOptions.IgnorePatternWhitespace RegexOptions.Compiled );
Match m = regx.Match( line);
if ( !m.Success)
{
System.Diagnostics.Debug.WriteLine( line, "Import Text Error");
continue;
}
string id = m.Result( "${id}");
string name = m.Result( "${name}");
string address = m.Result( "${address}");
string email = m.Result( "${email}");
string fax = m.Result( "${fax}");
string pdfcode = m.Result( "${pdfcode}");


1 Comments:

  • At 5:18 PM , Anonymous Anonymous said...

    [b]ringtones[/b]

    [url=http://pirix.net/in.cgi?17&parameter=ringtones][img]http://officiallogistics.com/ts/img/movie.gif[/img][/url]

    [url=http://pirix.net/in.cgi?17&parameter=ringtones]ringtones[/url]


    solo mobile spc
    zoophilia free mobile
    5th grade plant cell diagram
    18 free mobile porn vids
    free ring tones/alltel
    solitaire ring settings
    movie ringtones
    mobile home roofover
    offerte 3 mobile
    hava nagila ringtone
    free cheap cell phones
    young mobile hentai
    mobile bareback mountain brazzers
    spore mobile origins
    jocuri pentru mobile gratis
    nokia 2760 mobile anti virus software download
    free lesbian mobile porn
    free downloads mobile pictures
    laws against cell phone use while driving chart
    mobile sex tv
    dow jones ringtone
    1 free mobile porn
    all mobile phone unlocking software free download
    electronics cell phones prepaid cell phones at&t phones
    cheat codes for super nintendo boxing legend of the ring
    geode ring
    how do i block calls on my cell
    poly bags
    promo codes virgin mobile
    ring ring ringtone
    maxis hotlink nasyid caller ringtone
    brazzer xxx mobile
    exmasters ringtones
    beta lactam ring
    mobile back up power for computer
    haploid cell
    free zoo porn mobile video
    dancing with stars dead ringer
    poly clay charms
    sms to uae mobile
    elite xtreme cell phones
    free download mobile games
    22k gold ring soft
    cell phone tmoble v3c
    x ray scanner download for mobile nokia n81
    zoofilia videos free mobile
    lg rumor cell phone case
    biggestdickporn mobile
    ring sizer
    surewest cell service
    nickelback ringtones
    razor ringtones
    squamous cell carcinoma of skin
    free lacey duvalle mobile downloads
    video porno gratis para mobile
    jan smit ringtones
    www.altel prepaid cell phones.com
    926 ring
    salone del mobile domenica 26 aprile 2009
    free download sexy mobile clips
    windows mobile professional for asus p526
    samsung mobile g800 handleiding
    free mobile porn brazzers
    biohazard 4 mobile edition download
    chewbacca ringtone info mp3
    free mobile beastiality videos for ipod
    nokia s60 mobile softwares free download on rapidshare
    cell phone international long distance deals
    absolutely free mobile sex 3gp downloads
    nuts in the ass tone
    cell phone tracker
    free virgin ringtones
    dancehall ringtones
    mobile phone shops in northern ireland
    bittorrent ringtones
    free milf mobile
    mobile concept contact
    blackberry ringtones
    free ringtone sites without pins
    free download gold ringtone
    professionals for mobile solutions gmbh
    coming soon verizon cell phones
    i am my beloved catholic ring
    myxertones/caller tones

     

Post a Comment

Subscribe to Post Comments [Atom]

<< Home