473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

RegExp: Using groups to solve 1-n / "belongs to"-challenge

Hi!

I hope someone can help me with this challenge, which really bugs me... If
this is the wrong forum, please point me to a better one, as I have not been
able to find a better group for questions about regular expressions.

I have some data which has a structure something like this:

Header 1
- Item 1
- Item 2
- Item 3

Header 2
- Item 4
- Item 5

Header 3
- Item 6
- Item 7
- Item 8
- Item 9

Getting all headers is easy
Getting all items is easy
Getting a list of which items belong to which headers is... less than easy
(for me anyway). ;)

I want to execute a regular expression and get 9 matches like this:

Header 1 - Item 1
Header 1 - Item 2
Header 1 - Item 3
Header 2 - Item 4
Header 2 - Item 5
Header 3 - Item 6
Header 3 - Item 7
Header 3 - Item 8
Header 3 - Item 9

....With the header in group 1 and the item in group 2. Is that possible? If
so, how?

Any help would be greatly appreciated! :)

Thanks in advance

Klaus Jensen,
Nov 21 '05 #1
0 879

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jim G. | last post by:
I am attempting to develop an application for a client that will monitor Web Traffic on a Users PC (from a tray application that the user downloads) - I am NOT interested in blocking or limiting...
3
by: Toto | last post by:
Gray Davis is a desperate man. Facing recall, he has just put the safety of California motorists at risk in a naked bid to buy Hispanic votes. Davis signed into law a bill he had twice rejected, to...
10
by: eyh5 | last post by:
Hi, My C code (running on Soalris Unix) has some "segmentation fault" that I wish to use purify to do it. I poked around the web, and found some information about adding some lines in a Makefile...
4
by: YeeCN | last post by:
Hi, Can anybody tell me how to play a "beep" sound or any other sound at all in C#? I thought it would be easy but I have been searching up and down.... Thanks a lot. Best regards, Yee
1
by: Dave McCloskey | last post by:
How can I convert the "Enter" key to a "Tab" so my application will act like "Tab" has been hit when the "Enter" key has actually been depressed. This gives type-writer functionality to programs....
13
by: Morgan Bachu | last post by:
Hello everybody, I have an intranet application which is mostly a bunch of data editing forms. The database has about 20 tables all related together. Recently somebody deleted a "the wrong...
5
by: comp.lang.php | last post by:
$orderBy = 's.app_date desc, s.last_name asc, s.first_name asc, s.mi asc'; if ($_REQUEST) { $ascArray = array('asc' => 'desc', 'desc' => 'asc'); // ARRAY OF ALL ORDERING POSSIBILITIES $junk =...
1
by: D.M. | last post by:
Hi, One of the people here at work has designed a database that students will be using to enter data. She has Yes/No selection buttons, which start out grayed out with no value. If a student...
25
by: william.hooper | last post by:
here is my form: <html> <head></head> <body> <FORM ACTION="code.php" method="post"> <INPUT TYPE=SUBMIT NAME="arty.jpg" VALUE="Action"> </FORM>
6
by: grbgooglefan | last post by:
I am creating functions, the return result of which I am using to make decisions in combined expressions. In some expressions, I would like to inverse the return result of function. E.g....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.