Qurak

Highlight words of a given length

Esempio 2 passi, eseguiti in ordine in una sola sessione. Ogni passo è stato eseguito sul motore e l'output qui sotto è ciò che ha prodotto.

Passo 1
text = StringTake[ExampleData[{"Text", "AliceInWonderland"}], 400]
Output
StringTake[ExampleData[{Text, AliceInWonderland}], 400]
Passo 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]

Funzioni usate

Ricette correlate

Tutte le ricette · Guida delle funzioni · Usa questo da un client MCP