Not random, but no special tools required. To replace every fourth occurrence (case sensitive):
With (some) case insensitivity:
Find and Replace > Replace
Use wildcards = checked
Find: (<[Hh]appy>*)(<[Hh]appy>*)(<[Hh]appy>*)<[Hh]appy>
Replace: \1\2\3JOY
Replace All
Match case = checked
Find: JOY
Replace: (joy
|Joy
, as required)
(The repeat function ({3}
, {1,3}
) doesn't like wildcards (*
), so multifind statements like this have to be manually created.)
This can be made pseudorandom by replacing multiple times and with different occurrences (e.g. every 7th, then every 5th). The Find and Replace input boxes are limited to 256 characters, so there's only so many that can be done in one go (19 in this case). But any more than every 7th results in the error 'The Find What text contains a Pattern Match expression which is too complex':
(<[Hh]appy>*)(<[Hh]appy>*)(<[Hh]appy>*)(<[Hh]appy>*)(<[Hh]appy>*)(<[Hh]appy>*)<[Hh]appy>
\1\2\3\4\5\6JOY