Jump to content
You must now use your email address to sign in [click for more info] ×

Occurences F/R. GREP metacharacters.


Recommended Posts

Bonjour à tous.
Serait-il envisageable :
- d'indiquer le nombre d’occurrences lors d'un rechercher/remplacer.
- de pouvoir utiliser les métacaractères en lieux et places des caractères spéciaux proposés dans le menu déroulant paramètre. Ce serait plus lisible et plus facilement portable/éditable.
Merci pour le retour.

*****

Hello everyone.
Would it be possible :
- to indicate the number of occurrences during a search/replace.
- to be able to use metacharacters instead of the special characters proposed in the parameter drop-down menu. This would be more readable and more easy portable/editable.
Thanks for reponse.

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

1 hour ago, uneMule said:

to be able to use metacharacters instead of the special characters proposed in the parameter drop-down menu. This would be more readable and more easy portable/editable.

Can you give an example there of what you'd like to do?

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

le rechercher/remplacer est une vielle discussion. Le grep aussi.
J'ai relu ce topic hier. La date laisse songeur.

 

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

2 hours ago, uneMule said:

La date laisse songeur.

Regular Expressions for Find and Replace did not exist in the very early public beta of Publisher. That may explain the dates..

Thank you for the additional information on your metacharacter request. The problem with doing that, I think, is that there are no standard metacharacters defined for those functions. Picking new metacharacters is difficult for regular expressions as adding anything beyond the standard set of characters can cause problems with the regular expression processing. (I am not explaining that very well. Sorry.)

 

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

Bonjour @walt.farrell. Allez-vous bien ?
Nous avons déjà eu, en substance cette discussion, il y a quelque temps. Et comme je le disais @Wosven, j'ai relu cet ancien sujet qui aborde l'intégration du GREP/Expression régulière (il semble que la communauté n'aie pas tranché).
Il y a une réponse que je peux faire, mais qui n'est pas très "jolie" est que, dans InDesign, tout/beaucoup est commenté.
Donc, en béotien, je dirais "c'est possible et pourquoi pas."
Maintenant et de mon point de vue, et comme évoqué dans le sujet précité, il est possible de tester des expression avec différentes solutions si (et seulement si) l'expression régulière est écrite avec des caractères qu'on peut copier/coller.
De plus, et comme cela a été déjà évoqué ailleurs, cela permet également de les sauvegarder (avec un nom qui parle !).

Pour ce qui est des occurrences, et @Wosven a bien développé le principe qui consiste à valider rapidement une recherche car parfois on connait a priori la quantité qui doit être retournée. Simple mais pratique.

*****

Hello @walt.farrell. How are you?
We've already had, in essence, this discussion some time ago. And as I was telling @Wosven, I re-read this old topic which discusses the integration of GREP/Regular Expression (it seems the community has not decided).
One answer I can make, but it's not very "pretty" is that, in InDesign, everything/many things are commented out.
So, as a philistine, I would say "it's possible and why not."
Now and from my point of view, and as mentioned in the aforementioned topic, it is possible to test expressions with different solutions if (and only if) the regular expression is written with copy/pasteable characters.
Moreover, as already mentioned elsewhere, this also allows them to be saved (with a name that speaks!).

As for the occurences, and @Wosven has well developed the principle of quickly validating a search because sometimes we know a priori the quantity to be returned. Simple but practical.

Below is the previous discussion. Kind regards.

 

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

2 hours ago, uneMule said:

We've already had, in essence, this discussion some time ago.

Thank you for that reminder.

In essence, from the research shown there, you know what the actual characters are for a number of situations:
 

Quote

Espace U+0020
Espace cadratin    U+2003
Espace demi-cadratin    U+2002
Espace insécable    U+00A0
Espace insécable court    U+202F
Espace sans chasse    U+200b
Espace ultra-fin    U+200a
Espace fin     U+2009
Espace de ponctuation    U+2008
Espace tabulaire    U+2006
Antiliant sans chasse    U+200c
Tabulation    U+0009

Perhaps the special character pull-down in Find and Replace could be enhanced to show the actual characters, which would make it easier to use them in the regex. But defining true meta-characters in the usual sense of regular expressions (e.g., \t or [:space:]) would be very difficult for all those special cases, in my opinion.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

@walt.farrell

Personnellement, quelque chose dans le genre m'irait très bien.

https://helpx.adobe.com/fr/indesign/using/find-change.html#metacharacters_for_searching

L'unicode ne fait pas tout (je me souviens m'être amusé pour faire cette liste).
Mais si vous avez un équivalent pour la fin de paragraphe et le saut de ligne forcé (ou changement de ligne) ?

*****

Personally, something like this would suit me very well.

https://helpx.adobe.com/fr/indesign/using/find-change.html#metacharacters_for_searching

Unicode do not everything (I remember having fun making this list).
But what if you have an equivalent for the end of paragraph and the forced line break?

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

22 minutes ago, uneMule said:

But what if you have an equivalent for the end of paragraph and the forced line break?

End of paragraph (Paragraph Break) is \n, but \r also works.

Line Break or Paragraph Break is \R

Line Break alone is \x{2028}

 

 

 

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

2 hours ago, walt.farrell said:

End of paragraph (Paragraph Break) is \n, but \r also works.

Line Break or Paragraph Break is \R

Line Break alone is \x{2028}

I think it is unfortunate that line break doesn't get its standard \n designation, but rather that more complicated designation. In all the regex varieties I am familiar with, \n and \r are two distinct meanings (new line vs carriage return). And although I have found Publisher to occasionally be more powerful at regex than InDesign, I did appreciate being able to use the simple distinction between \n and \r. 

Link to comment
Share on other sites

3 minutes ago, garrettm30 said:

And although I have found Publisher to occasionally be more powerful at regex than InDesign, I did appreciate being able to use the simple distinction between \n and \r.

Oui. changement de ligne U+2028 et changement de paragraphe U+2029, c'est pas très sexy !

*****

Yes. line change U+2028 and paragraph change U+2029, it's not very sexy!

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

39 minutes ago, uneMule said:

and paragraph change U+2029, it's not very sexy!

But you don't need to use U+2029; just use \n or \r :)

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 hour ago, walt.farrell said:

But you don't need to use U+2029; just use \n or \r :)

I don't let go my Kleenex. 😭

Toujours pas !
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.