Topic awaiting preservation: Complex Regular Expression (Page 1 of 1) |
|
---|---|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 12-22-2005 20:46
I have a file that has two types of code blocks. The different blocks will have unique id's, so no ft:widget will have the same id. There will also be a good deal of HTML thrown into the mix. code: <ft:widget-label id="id1"></ft:widget-label> <ft:widget id="id1"></ft:widget>
code: <ft:widget-label id="id1"></ft:widget-label> <ft:widget id="id2"></ft:widget> <ft:widget id="id1"></ft:widget> <input onclick="grabme"/>
code: <tr> <td ><label for="id1"><ft:widget-label id="id1"/></label></td> <td>$ <ft:widget id="id1"><fi:styling class="rightIndent" /></ft:widget></td> <td ><label for="id2"><ft:widget-label id="id2"/></label></td> <td>   <ft:widget id="id3"><fi:styling type="hidden"/></ft:widget><ft:widget id="id2"><fi:styling/></ft:widget> <input type="button" onclick="value=2" value="..."/> </td> </tr>
code: pattern = '<ft:widget-label id="([^"]+)".*?<ft:widget id="([^"]+)".*?onclick="([^"]+"'
|
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 12-22-2005 21:00
I think that I can simplify this by saying I want to find the pattern |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 12-22-2005 22:15
I narrowed down what I was looking for, by adding some more information into the search and I was able to pull out the information that I was looking for. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 12-22-2005 22:34
very well - me head wasn't up to that tonight |
Paranoid (IV) Inmate From: Madison, Indiana, USA |
posted 12-23-2005 19:21
I'm glad you fixed it. I guess I'm a bit late with this response, but had some thoughts in case you run in to a similar stuation in the future. code: $content =~ s/^.*?<td ><label for="id2">//s; $content =~ s'</table>.*$//s; @array = ($content =~ m/$pattern/gs);
|