Bulk Replace
How-to

How to Find and Replace Text in Many SRT Subtitle Files at Once

Fix a misspelled name, remove hearing-impaired tags or update terms across a season of SRT subtitles at once, without breaking the timing lines.

Updated 4 minute read The Bulk Replace team

To find and replace text in many SRT subtitle files at once, run a find and replace across the folder of .srt files with patterns that only touch the dialogue lines. SRT files are plain text, so a misspelled name can be fixed with a whole-word, case-sensitive rule (for example \bJon\b to John), and hearing-impaired tags such as [MUSIC] can be removed with \[[^\]\r\n]*\]. The one thing to protect is the structure: the cue numbers, the timing lines with their --> arrow, and the blank line that ends each cue.

Below is how an SRT file is put together, tested patterns for the common clean-ups, and a check you can run afterwards to make sure nothing broke.

How an SRT file is structured

Each subtitle, called a cue, has four parts:

  1. A sequence number, such as 12.
  2. A timing line: 00:01:02,500 --> 00:01:05,000, with a comma before the milliseconds.
  3. One or more lines of text.
  4. A blank line, which ends the cue.

Players rely on that pattern. If a replace removes the blank line between cues, two cues merge. If it leaves a blank line where text used to be, the cue can end early. If it alters a digit in a timing line, the subtitle appears at the wrong time or the whole file fails to load. Every pattern below is written to avoid those three problems.

Fix a name or term across a season

A misspelled character name is the most common fix. Use whole-word, case-sensitive matching:

  • Find: \bJon\b (match case on)
  • Replace: John

Whole word stops it changing Jonas or Jones. Case-sensitive matching stops it changing a lowercase word that happens to share the letters. If the name also appears in capitals, as in speaker labels, add a second rule for \bJON\b. Whole-word matching is explained in more detail in find and replace whole words only.

Terms that come up across a series, such as a place name or a made-up word, often need several spellings fixed. Stack them as separate rules or import them as a list; our guide to bulk find and replace from a CSV list shows how.

Remove hearing-impaired tags (SDH)

Subtitles for the deaf and hard of hearing include sound descriptions and speaker labels. To make a plain dialogue version, remove them in this order:

StepFindReplaceRemoves
1^[ \t]*\[[^\]\r\n]*\][ \t]*\r?\n(nothing)Lines that contain only a bracketed tag, such as [MUSIC PLAYING]
2^[ \t]*\([^)\r\n]*\)[ \t]*\r?\n(nothing)Lines that contain only a tag in parentheses, such as (door slams)
3[ \t]*\[[^\]\r\n]*\](nothing)Remaining bracketed tags inside dialogue lines
4^[A-Z][A-Z ]+:[ \t]*(nothing)Speaker labels such as JOHN: at the start of a line

Steps 1, 2 and 4 need multiline mode, so ^ matches the start of each line. Step 4 must also be case-sensitive; otherwise it would remove the start of ordinary lines like Note: this.

The order matters. Removing whole-line tags first, including their line break, avoids leaving an empty line in the middle of a cue, which players would read as the end of the cue. The classes [^\]\r\n] and [^)\r\n] keep each match on one line, so a stray bracket can never swallow the following cues.

A cue whose only line was a tag ends up with a timing line and no text. Most players simply show nothing for that cue, but if you want a tidy file, remove those empty cues in a subtitle editor afterwards, which can also renumber the cues.

Other common clean-ups

JobFindReplace
Remove italic tags</?i>(nothing)
Remove font color tags</?font\b[^>]*>(nothing)
Replace two hyphens with an ellipsis--(?!>)...
Remove double spaces(?<=\S) {2,}one space
Fix a recurring typo\bteh\bthe

The ellipsis rule uses a negative lookahead so the --> arrow in timing lines is never touched. That is the general rule for SRT work: any pattern that could match digits, colons, commas or the arrow should be checked against a timing line before you run it.

What not to do with find and replace

  • Shift timings. Moving every subtitle two seconds later means arithmetic on each time stamp, including carrying seconds into minutes. A subtitle editor's sync or shift feature does this properly.
  • Renumber cues. Also arithmetic. Subtitle editors renumber automatically.
  • Convert between formats such as SRT and VTT. The time stamp format and header differ, so use a converter or a subtitle editor.

Encoding

Older SRT files are often saved in ANSI, while newer ones and most streaming platforms use UTF-8. If a file shows garbled accented characters after editing, it was read in one encoding and written in another. Keep each file in its original encoding unless you have decided to convert them all, in which case UTF-8 is the safest target. See UTF-8 vs ANSI vs UTF-16 for how to tell which one you have.

Check the files afterwards

  1. Count timing lines before and after. In PowerShell: (Select-String -Path *.srt -Pattern '-->').Count. The number should not change.
  2. Search for the old name or tag again. The count should be zero.
  3. Open one episode in a video player and skip through it. Check that subtitles appear at the right times.

A whole season in one run

Bulk Replace works through every .srt file in a folder and its sub-folders, with the rules above stacked to run in order during one pass. The before/after diff shows each changed line in context, so you can confirm that only dialogue changed and no timing line was touched, and untick anything you want to keep. Bulk Replace preserves each file's encoding, whether ANSI or UTF-8, and backs up the whole run, so if a player complains about a file, one click restores the originals. Save the rules as a project and the same clean-up can be applied to next season's files in two clicks.

Frequently asked questions

Can find and replace break SRT timings?

Only if your pattern matches the timing lines. Keep patterns specific, and avoid replacing digits, colons or the --> arrow.

What regex removes text in square brackets from subtitles?

\[[^\]]*\] matches text such as [MUSIC] or [door slams]. Replace it with nothing, then check for lines left empty.

What encoding should SRT files use?

UTF-8 is the safest choice for modern players and platforms. Older files may be ANSI, so keep the original encoding unless you need to convert.

Get three guides like this every month, plus software update notices.Subscribe →