Copy link to clipboard
Copied
Hi There,
I'm creating a FindChangeBy list of GREPs to run, and I'm trying to Superscript ordinals as one of my items. But I dont' know how to write the code to say position = Superscript. I have my Find what, I just don't know what my second item needs to be. Please help
It seems you are missing the escaping of the special characters. Change \ with \\ so the first grep string should be like following
grep {findWhat:"\\d\\K(th|st|nd|rd)\\>|[\\w\\s]\\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
-Manan
Copy link to clipboard
Copied
Try
position = Position.SUPERSCRIPT
-Manan
Copy link to clipboard
Copied
I may need more explanation than that. Is this correct?
grep {findWhat:"\d\K(th|st|nd|rd)\>|[\w ]\K(~r)"} {position = Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
Copy link to clipboard
Copied
Replace = with :
So it becomes
{position:Position.SUPERSCRIPT}
-Manan
Copy link to clipboard
Copied
It still isn't working. Do I need to add something like changeTo: to it? Here is my full FindChangeBy list:
grep {findWhat:"\d\K(th|st|nd|rd)\>|[\w\s]\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
grep {findWhat:" ([\u]{2}) +(\d{5})"} {changeTo:" $1~>$2"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
grep {findWhat:" (([\u\l]) (Jr|Jr.|Sr|Sr.|Esq|Esq.)( |\n|\r|\t|~y)"} {changeTo:"$1, $2$3"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
What would be the reason that this isn't working? My GREP works fine for the layout, but it seems I don't know enough about code yet to troubleshoot
Copy link to clipboard
Copied
It seems you are missing the escaping of the special characters. Change \ with \\ so the first grep string should be like following
grep {findWhat:"\\d\\K(th|st|nd|rd)\\>|[\\w\\s]\\K(~r)"} {position:Position.SUPERSCRIPT} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
-Manan
Copy link to clipboard
Copied
That was it. Thank you. Didn't realize I needed to escape them even when its within quotes.