[Cialug] RegEx

Tim Wilson tim_linux at wilson-home.com
Wed Oct 12 14:51:28 CDT 2005


Sorry, don't know PHP, but I'm becoming more educated on regular
expressions.  Try this:

sed -e 's/<st1.*>\(.*\)<\/st1.*>/\1/' <foo.xml >foo.txt

You could also create an xslt stylesheet, and run it on the data.



On 10/12/05, Bailey, Jonathan C <bailj0 at bp.com> wrote:
>
>
> Working with PHP regex.. I'd like to use ereg_replace, but preg would be
> fine…
>
>
> I want to remove the following, including the closing tags:
>
> <st1:place w:st="on">
> <st1:City w:st="on">
>
> (word smart tag stuff)
>
> Pretty much, I want to replate <st1**WILDCARD**> and </st1**WILDCARD**> with
> nothing. I don't want to remove the text between the tags.
>
>
> Regex $deity, please help!
>
>
>
> ------------------------------
>  "Docendo discimus"
>
> Jonathan C Bailey
> Customer Care - POS
> (888) BP-HELP-U
> (630) 300-5301 x5301
>
> 150 W Warrenville Rd
> Mail Code 200-1011T
> Naperville, IL
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
>
>


--
Tim


More information about the Cialug mailing list