Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Select inline styles (See related posts)

Selects inline styles. I purposely excluded quotation marks from the character set because they cause the expression to select attributes of other tags on the same line.

style="[\s\d\w\.\-\:\;]+"


Edit: Here's a shorter way of accomplishing the same thing:

style="[^"']+"


It's probably worth adding a space before the expression to make sure that you don't leave in unnecessary spaces in the tag and to avoid selecting things that are not styles, such as the bold part of




Comments on this post

bernd posts on Dec 26, 2007 at 17:27
Yea, more of these.

You need to create an account or log in to post comments to this site.


Related Posts