SunQuest
 
           Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old January 24th, 2003, 10:44 PM
maui72 maui72 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 maui72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Regular Expression for each header get all data before next header?

Hi,

I'm trying to develop a regular expression to extract records from a page of text designed to be for human readible rather than machine readible.

the general problem is that there is a header and then one or more data lines, followed by another header then more data lines etc. I've generated character class which match the headers and data, but i cannot figure out how to get all the data records which belong to a particular header

i.e. given a file like this

header1
data1
data2
data3
data4
header2
data5
data6

I want the following matches

header1 data1
header1 data2
header1 data3
header1 data4
header2 data5
header2 data6

Hence the problem is, geiven a match to the header character class, match all possible data classes which occur before the next header class match.

I'm sure this can be done, but I cannot figure out how. I tried

(header.).*(data.)

which I though would do half the job but I'm only getting one match?

Regards

Dave

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Regular Expression for each header get all data before next header?


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 2 hosted by Hostway