Mass Find and Replace in Notepad++ using Regular Expressions

While working on an upgrade to ILLiad 8.6 from 8.5 I was reminded that the tabindex attribute is not necessary and that I haven’t yet completely removed this code from our ILLiad webpages. I’ve removed some of the references, but at first glance, I’ve assumed this task would be daunting, after all, there are dozens of webpage files that would need to be checked.

Not so much! With about 5-10 minutes of thinking/work, I was able to remove over 400 instances of tabindex in all of our ILLiad webpages!

After some testing on a small batch of files I settled on the following process:

  • First, I created a regular expression to match our tabindex instances: (tabindex=”)\d+(“)
  • Then, I opened all of my local ILLiad webpage copies in Notepad++
  • Using the Replace feature (Search->Replace), enter the regular expression in Find What
  • Under Search Mode, select Regular Expression
  • Click Replace All in All Opened Documents
  • Then click File -> Save All
  • Finally copy the local files to the server
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s