jon31
09-05-2006, 04:44 PM
Hello folks,
I'm currently trying to tackle some simple Regex to find certain text in my string and encapsulate it in tags. Here's an example of the string I'll be finding/replacing and encapsulating:
Chapter 4: ROUTING AND RECORDING
Section 1: The I/O Window
99: In-Out Overview
100: Resampling
101: Submixes
102: More Complex Routing
103: Complex Routing - Guitars
104: Extreme MIDI Routing
1) "Chapter 4: ROUTING AND RECORDING" needs to be encapsulated in <span style="span1"></span>
2) "Section 1: The I/O Window" needs to be encapsulated in </span style="style2"></span>
3) "99: In-Out Overview
100: Resampling
101: Submixes
102: More Complex Routing
103: Complex Routing - Guitars
104: Extreme MIDI Routing" needs to be encapsulated in <div style="div1"></div>
Can someone get me started? I've been fighting with regex and preg_replace for the past couple hours, and haven't been able to get anywhere yet.
Thanks!
Jon
I'm currently trying to tackle some simple Regex to find certain text in my string and encapsulate it in tags. Here's an example of the string I'll be finding/replacing and encapsulating:
Chapter 4: ROUTING AND RECORDING
Section 1: The I/O Window
99: In-Out Overview
100: Resampling
101: Submixes
102: More Complex Routing
103: Complex Routing - Guitars
104: Extreme MIDI Routing
1) "Chapter 4: ROUTING AND RECORDING" needs to be encapsulated in <span style="span1"></span>
2) "Section 1: The I/O Window" needs to be encapsulated in </span style="style2"></span>
3) "99: In-Out Overview
100: Resampling
101: Submixes
102: More Complex Routing
103: Complex Routing - Guitars
104: Extreme MIDI Routing" needs to be encapsulated in <div style="div1"></div>
Can someone get me started? I've been fighting with regex and preg_replace for the past couple hours, and haven't been able to get anywhere yet.
Thanks!
Jon
