Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2006

Tip: Looking for answers? Try searching our database.

Using Regular Expressions in .NET Framework 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian Roisentul - 11 Oct 2006 18:15 GMT
Hello,

I'm developing a windows application where I use regular expressions.

In first place, I did it in c#(visual studio 2003) and now I'm
migrating it to visual studio 2005.

The problem here is that a regular expression doesn't match an xml
string in visual studio 2005, but in visual studio 2003 does. Is the
same code in both and the same xml string.

Can anybody helps me?

Thanks,

Brian
intrader - 11 Oct 2006 18:56 GMT
> Hello,
>
[quoted text clipped - 12 lines]
>
> Brian

Provide the regular expression you are using and the XML snippet you are
having problems with
Brian Roisentul - 12 Oct 2006 14:30 GMT
Hello,

Thanks for your quick response, here is the regular expression I'm
having problems with:

(?<date>\d{4}-\d{2}-\d{2})(?<time>T\d{2}:\d{2}:\d{2}.\d{7}-)(?<hour>\d{2})(?<last>:\d{2})

The string that must match would be something like
"2006-04-06T14:03:33-03:00".

If I try to parse only that string(without the rest of the xml) it
works, but it doesn't if I try with the whole xml string.

NOTE: It does work in Visual Studio 2003, but not in 2005.

Thanks,

Brian
Brian Roisentul - 12 Oct 2006 14:41 GMT
Hey, I'm sorry I didn't show you the xml string.

Here it is:

"<NewDataSet><Table><tp_ID>1</tp_ID><tp_ListId>e86df149-dcae-4344-83e1-ef9be5bb99cb</tp_ListId><tp_SiteId>b98533db-58a3-48c2-af6e-62241e4afa26</tp_SiteId><tp_Version>7</tp_Version><tp_Author>1</tp_Author><tp_Editor>1</tp_Editor><tp_Modified>2006-04-06T14:03:33-03:00</tp_Modified><tp_Created>2006-03-21T17:27:52-03:00</tp_Created><tp_HasAttachment>false</tp_HasAttachment><tp_ModerationStatus>0</tp_ModerationStatus><tp_IsCurrent>true</tp_IsCurrent><tp_ItemOrder>100</tp_ItemOrder><tp_GUID>64686e35-f5d2-4c06-b2ac-f4188afd122e</tp_GUID><tp_Size>26</tp_Size><nvarchar1>All</nvarchar1><float1>1</float1></Table></NewDataSet>"

The fields that must match are "<tp_Modified>" and "<tp_Created>".

Thanks,

Brian
intrader - 12 Oct 2006 16:41 GMT
> Hey, I'm sorry I didn't show you the xml string.
>
[quoted text clipped - 7 lines]
>
> Brian

I think that I would start with an anchor, end with an anchor, don't use
Microsoft extras and express the Regular Expression as
/>(\d{4}-\d{2}-\d{2})?*?</
If your xml is well formed that should do it.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.