Categories
Development Web

Regex to find CSS Class Uses

I needed this to find uses of a specific CSS class in order to replace them all with a namespaced version.

class=(["a-z\-]*[" ]+)(nav)([ "])

Optionally use the replacement text below, complete with variable markers. In this case, “nav” will be prefixed with “forum-“.

class=$1forum-$2$3

By Ben

Web developer and avid gamer.

2 replies on “Regex to find CSS Class Uses”

Good post. I learn something new and challenging on websites I stumbleupon everyday.
It’s always useful to read through content from other writers and use
something from their web sites.

I see your page needs some unique content. Writing manually is time consuming, but there is
tool for this task. Just search in gooogle for; Avurker’s essential tools

Leave a Reply

Your email address will not be published. Required fields are marked *