Forum Replies Created
-
AuthorPosts
-
Dhafir Photo
ParticipantMore explanations
\S+ Matching anything in italic except the space, so it will matching every word in the italic line
[\S]+ Matching the end of the italic line, because we don’t need matching every italic word, but we need “Finding partial words in italics” as in the title!Dhafir Photo
ParticipantThe main reason to include the horizontal space
because if there one or more lines are italic, we need to specify the end of it only, not every word in itDhafir Photo
ParticipantThere is no difference between the code dot .+ and this regex, but I usually use this because it’s faster than the dot in search. (For me)
By the way, in this particular case, you can use many other codes or regex to catch the same result:
.+
\C+
\p{any}+
\p{assigned}+
[\V\v]+
[\W\w]+
[\H]+
[\D\d]+
[\S]+
or [\S]+Dhafir Photo
ParticipantHello David!
Let’s to dive
\S means any character except whitespace or break character, means horizontal white space and tab
so [\S]+ with find format italic, will match everything in italic except breaks.
Then put “non-joiner” (or any other zero width character such as “End Nested Style Here”) after the last italic character found.
Now, you’ll find the letters before and after non-joiner, and make it italic, by: \p{l*}*~j\p{l*}*
\p{l*} Any letter of any language
* Does not exist or exists many times
The trick is using the non-joiner as location pointing to the presence a letter \p{l*} in italic before or after it.Dhafir Photo
ParticipantActually you can use global change for convert all words to italic:
1.
in Find: [\S]+
in Find Format: italic
in Change: $0~j2.
in Find: \p{l*}*~j\p{l*}*
in Change Format: italicDhafir Photo
ParticipantHello David!
In this case just add (?s) “Single-Line On” before the regex: (?s)^\S+\S+\KDhafir Photo
ParticipantBy 3 steps in GREP tab of Find/Change window:
1. Add non joiner to the end of the italic:
in Find: [\S]+
in Find Format: italic
in Change: $0~j2. Find non italic
in Find: ~j\p{l*}+
in Change Format: Italic3. Delete non joiner character
if Find: ~j
in Change: Leave emptyDhafir Photo
ParticipantTry this mad trick
Create a character style with Horizontal Scale: 1000%, and Tracking: 10000
Then use it with GREP Style by this regex ^\S+\S+\KDhafir Photo
ParticipantThere is a useful script for this issue by LFCorullón Scripts “Change Case By Style”:
https://corullon.com.br/scripts/?s=Change+case+based+on+styleDhafir Photo
Participantin Find: ([\d,]+)( × )([\d,]+)
in Change: $3$2$1November 30, 2021 at 9:31 pm in reply to: How do you apply an alternative number 1 in a font automatically #14351190Dhafir Photo
ParticipantMake character style for “Gill Sans Std” font family
then use GREP Style for number 1 with the character styleDhafir Photo
ParticipantTry this:
in Find: ^.+?\K;(.+?)-.+$
in Change: $1Dhafir Photo
ParticipantHello David!
Yes that’s right
\S All characters except Spaces, breaks, separators, right indent tab, and indent to here
Horizontal whitespace including tabDhafir Photo
ParticipantTry this:
in Find: \$([\S]+?)\$
in Change: $1
in Change Format: ItalicOctober 31, 2021 at 11:29 pm in reply to: Italicized text in parenthesis, with a twist! (GREP) #14349654Dhafir Photo
ParticipantUse this: \$.+?\(\K.+?(?=\))
-
AuthorPosts
