Qurak

Highlight words of a given length

Example 2 steps, run in order in one session. Every step was executed against the engine and the output below is what it produced.

Step 1
text = StringTake[ExampleData[{"Text", "AliceInWonderland"}], 400]
Output
StringTake[ExampleData[{Text, AliceInWonderland}], 400]
Step 2
Manipulate[TextCell[Row[List@@StringReplace[text, {RegularExpression["\\b\\w{" <> ToString[u] <> "}\\b"] :> Style["$0", 18, Bold]}]], "TR"], {u, 1, 10, 1}, SaveDefinitions -> True]
Output
Manipulate[TextCell[Row[List @@ StringReplace[text, {RegularExpression[StringJoin["\\b\\w{", ToString[u], "}\\b"]] :> Style["$0", 18, Bold]}]], TR], {u, 1, 10, 1}, SaveDefinitions -> True]

Functions used

Related recipes

All recipes · Function reference · Use this from an MCP client