|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Regular Expression for each header get all data before next header? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|