.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old March 12th, 2004, 02:21 AM
timbuktwo timbuktwo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 timbuktwo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
C# Newbie help with regexp and files.

My company let go all the people with skill, and then dumped some 'simple' work on me, Only I have never done c#. I was the PC Tech.

I need to scan through a file and return the characters after a keyword, and before a paren. ex:
keyword whatINeed(

I would need to return WhatINeed.
in the file there will be many matches to the key word, and WhatINeed will be different most of the time.

I suspect I can use System.Text.RegularExpressions with the stream, but I'm not sure.

Reply With Quote
  #2  
Old March 13th, 2004, 05:45 PM
timbuktwo timbuktwo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 timbuktwo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
so far

I am working with this string for this example:
keyword WhatINeed_A(foo, bar);keyword WhatINeed_B(foo, bar);


I have tried
@"keyword.*\("
but this returns:
keyword WhatINeed_A(foo, bar);keyword WhatINeed_B(


I really just need:
WhatINeed_A
WhatINeed_B

However, if the close as I can get is:
keyword WhatINeed_A(
keyword WhatINeed_B(

I could work wth that.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > C# Newbie help with regexp and files.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT