Hi @99drine and others, this is a challenge that comes up from time to time and yes, enforcing stylesheets is the answer, but how do you apply the stylesheet automatically if you can't perform the search for the point size?
I've written a script that can solve this particular problem. I tested it on your sample document @99drine and it worked as expected.
To use, first perform a normal find/change grep for the target point size: 4.6pt. In the change to field, set the point size also to 4.6pt. Then run the script, which perform that change on any text found within POINT_SIZE_THRESHOLD (see script) of the target point size. In my screenshot below I also changed it to blue, so you could see.
Let me know if it helps.
- Mark
Screenshot 1

Screenshot 2
Screenshot 3

/**
* @file Find/Change Grep Using Fuzzy Point Size.js
*
* Usage:
* 1. Perform an initial find/change grep via the UI
* and must include a target point size value, eg. '4.6pt'
* (include whatever other criteria for the finding
* and changing that you like).
* 2. Run this script.
*
* Will perform the change grep on any text that is
* within `POINT_SIZE_THRESHOLD` of the target point size.
* Configure the threshold by editing this script below.
*
* @author m1b
* @version 2025-11-08
* @discussion https://community.adobe.com/t5/indesign-discussions/how-do-i-search-replace-text-that-is-not-standard-size-decimal-numbers/m-p/15581291
*/
function main() {
var POINT_SIZE_THRESHOLD = 0.05; // pts
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
if (
undefined == app.findGrepPreferences.pointSize
|| NothingEnum.NOTHING === app.findGrepPreferences.pointSize
)
return alert('Please perform an initial find grep for a target point size, eg. "4.6pts".');
var doc = app.activeDocument;
// this is the point size we are looking for
var targetPointSize = app.findGrepPreferences.pointSize;
// don't specify the point size for this search, we'll check it later
app.findGrepPreferences.pointSize = NothingEnum.NOTHING;
var findWhat = app.findGrepPreferences.findWhat
// find all text
app.findGrepPreferences.findWhat = '.*';
// do the find
var found = doc.findGrep();
// check point size of each style range
var counter = 0;
for (var i = 0, parts; i < found.length; i++) {
parts = found[i].textStyleRanges;
partsLoop:
for (var j = 0; j < parts.length; j++) {
if (Math.abs(parts[j].pointSize - targetPointSize) > POINT_SIZE_THRESHOLD)
// size difference is too great, not interested
continue partsLoop;
// perform the change as specified earlier via find/change grep UI
parts[j].changeGrep();
counter++;
}
}
alert(counter + ' replacement made.');
// cleanup
app.findGrepPreferences.pointSize = targetPointSize;
app.findGrepPreferences.findWhat = findWhat;
};
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Fuzzy Find/Change');
Edit: screenshots for clarity.