I'm having difficulties understanding my problem here. If anyone can help, I'll be very thankfull 😉
I would like to find any punctuation between brackets in order to apply a condition on them (via a script). But my grep doesn't work 😕
I thought I could modify another grep expression, the following one, that is looking for everything between brackets. This one works fine and I'm using it a lot.
If I consider using the posix [[:punct:]], why the following expression doesn't work, what should be done in order to fix it ?
Thanks for your insight
Example: (need to get the 2 commas between the brackets, but not the one outside)
Hello Indesign folks (men, women, possibly lost aliens), I need your help.
That is only going to work if there is nothing but punctuation between the parentheses. Can you show us some examples of the actual text you will be searching?
Thanks for you reply.
The overall goal is to use a script that sorts alpha words separated with commas. The script makes it done as long as there aren't any unwilling commas in the sentence, like the one that appear between parentheses.
I'd like write a script that can "neutralise" every commas thar are between the parentheses. The main frame of the script is done, except the Grep expression for finding the commas.
Ex 1: I'd like to be able to
I can easily sort the words :
- Punching, Licking, Throwing
because they are "simply" separated by commas.
Ex2: I cannot use my script yet with the folowwing sentence
- Punching (Boxing, Wing Chun, Karate), Kicking (Kickboxing, Taekwondo, Capoeira, Savate), Throwing (Hapkido, Judo, Sumo, Wrestling, Aikido)
because of the commas appearing between the parentheses.
I'd like to write a grep expression that allows me to select the commas between:
Boxing, Wing / Chun, Karate / Kickboxing, Taekwondo / Taekwondo, Capoeira / Capoeira, Savate / Hapkido, Judo / Judo, Sumo etc.
This way, I could apply a conditional text that will "hide" the commas. I'll then apply my sort script and delete the contion for the whole text to reappear.
That's the one I'm using (see my first post) but selects the whole text between parentheses.
For some reasons (linked to the behavior of the sort script) I need to focus on only looking for the commas.
Try this one...
If you need to select more than just the , use this one and add your punctuations inside the [ ] like so.
Merci Jean-Claude pour ta réponse,
A hell of an grep !
Very close to what I'd like to achieve, but…
The expression reaches every single punctuation (which is already good, something I didn't succeed to) but the thing is, I'd like to reach only the ones between parentheses.
I'm still not much familiar with the \K and \R and wonder what to modifiy to narrow the search between the parentheses
This GREP only select the , when between parentheses.
Have you try it in Find/Change or GREP Style?
I tried with Find/change.
Oh I see, you have more than one group of parantheses... In this case use this:
I knew you were a genius, now, I experience it ^^
Works as a charm. Thank you very much !
… and I have to do my homework in order to understand this quite complex grep expression. There is no way I could have found it by myself.
Thanks again !
Terrific website. Didn't know it at all. Thanks for the tip 😉