Handy regular expressions

This is just a memo for myself to remember all regular expression that I often use:

  1. Remove sh*t from movie’s subtitles:
  2. Other:

Surround with / for JavaScript (and JSON?). Thus first example (\(([^)]+)\)) becomes /\(([^)]+)\)/.

Probably no use for anyone else except me, sorry! :>

Replace all sound-like sentences in subtitles

I’m as big fan (maniac) of perfectly crafted movie subtitles as I’m a regular expression newbie (ignorant). I simply don’t understand them and I’m pretty scared of each attempt / need of using them.

Until today, my biggest problem about movie subtitles were “sound-like” sentences. Manual removal of 100+ lines out of 400+ subtitle files wasn’t and option. Today, I said to myself, that I’m going to sit by the computer until I don’t figure out a regular expression, which I can feed into Notepad++ and replace all of this junk-like (at least to me) text out of each of my movie subtitle.

So I did. Finding proper regular expression for such extremely easy task is a snap of fingers for every regular expression freak. For regexp-ignorant, like me, it took no more than five minutes, so I managed to get on time for diner back home.

Read More “Replace all sound-like sentences in subtitles”