From: James Edward Gray II Date: 2006-02-13T02:20:19+09:00 Subject: Re: Cutting a piece of text On Feb 12, 2006, at 11:05 AM, Zdebel wrote: > I wish I knew how this (/<(\w+)[^>]+>/, "<\\1>") > regular expresion works :). It reads: / < # find a < character ( # capture this next part into $1 (\\1 in the replacement string) \w+ # followed by one or more word characters ) # end capture [^>]+ # followed by one or more non > characters > # and finally a > character /x The replacement just restores the <\w+> and leaves out the [^>]+ part (the space and attributes). Hope that helps. James Edward Gray II