PDA

View Full Version : Regex Help


sabret00the
05-12-2006, 12:42 PM
Hey folks, i've written a function, which uses itself in order to generate a list, however if the list already has a child, it needs to recognise this, then make the nessessary adjustments to the string. so if you do indeed follow me, what i'm after is the regex to find a line ending with "</ul>".

ps, i thought about using substr on the fly, but i thought that might be quite intensive???

Chroder
05-13-2006, 05:40 PM
/<\/ul>$/
This should work. Note you can't use the `m' pattern modifier in this case.

/<\/ul>\n/
This works, too.

sabret00the
05-23-2006, 10:44 AM
thanks chroder, i didn't need it for this but can use it for something else, that i'm wrokign on right now as it goes :)