Copy link to clipboard
Copied
I have a paragraph style with a first line indent of 0.25 inches. My imported text has much wider indent and so I've run the script below in Find and Replace to remove the space before indent. Unfortunately it only removes some of the space but not all and I have to manually fix the indents. Does anyone know how to tweak this code or is there an alternate script? Thank you!
^ +?(.)
1 Correct answer
Find ^(\s+)?(.)
Replace $2
Copy link to clipboard
Copied
Moving to InDesign Scripting forum
Copy link to clipboard
Copied
Surely not! … a simple Grep problem to be fixed!
"Script" doesn't systematically mean "Scripting"! Just need to read the question!
(^/)
Copy link to clipboard
Copied
So how do I fix this?
Copy link to clipboard
Copied
Find ^(\s+)?(.)
Replace $2
Copy link to clipboard
Copied
That worked!! Thank you!!
Copy link to clipboard
Copied
Thanks again!
Copy link to clipboard
Copied
Humm! Once again!
Of course, it will work but I'm absolutely and definitively not interested by this kind of Grep writing!
Find: ^\h+
Replace by: nothing
(^/)
Copy link to clipboard
Copied
Or just ^\s+ replacing for nothing.
Oh, my God, Obi. You're a genius.
Oh, my God. I never seen anyone like you.
Never.
Copy link to clipboard
Copied
I'm glad you learned something today!
… But anyone who knows a little Grep would have made the same comment! So, useless to be ironic!
(^/)
Copy link to clipboard
Copied
… And ^\s+ is not equal to ^\h+ really less greedy, especially useful if you take a look to the screenshot posted by Norman!
(^/)
Copy link to clipboard
Copied
Yes. Of course. Because of that you're a genius. You're the best of the
bests in grep and scripting.
But... Wow... Both works the same way.
But, look... I'm your fan. You're the best!!!
Copy link to clipboard
Copied
… Both works the same way.
Absolutely not!
(^/) [End of this thread for me!]
Copy link to clipboard
Copied
Absolutely yes. Both deals with the extra spaces the post owner asked for.
Copy link to clipboard
Copied
Test your 2 codes on Norman's screenshot text! …
[OFF!]
Copy link to clipboard
Copied
The first one worked for him.
Finish. Off.
Not always the things needs to be complicated. In most cases, the simplest
ways works fine.
Copy link to clipboard
Copied
Aha! Not sure it works correctly! …
As I already said: test!
I forgot! … You're wrong here too:
Re: Time formatting in indesign
(^/) [over!]
Copy link to clipboard
Copied
I'm not wrong. I just didn't used the same format than you. If it works; it
works.
You're the most clever man in this entire universe. I forgot to say.
Thanks for "share" your knowledge with us in this forum without charging
for it (ops!).
There is any other place where you share your adorable way to solve grep
and scripting stuff?
Copy link to clipboard
Copied
Did you?
Copy link to clipboard
Copied
You are both genius in my book!
Copy link to clipboard
Copied
Norman,
Could you post screenshots with the invisible chars?
(^/)
Copy link to clipboard
Copied
Here's a screenshot
Thanks for your help with this.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Do you just wanna remove the spaces at the beginning of para?
(^/)
Copy link to clipboard
Copied
I want it to have the 0.25 in. indent that's in my style. No extra spacing.

