[JS] RegExp tabulation Code

Enthusiast ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Hello,

Hello, stupid question, I cannot find the correspondence of the recipient of the right indentation tab (^y/~y) for an expression in RegExp? (instead of the point)

 

lesPaginations[test01].paragraphs[0].contents.replace(/.\d+/g,''));

 

 

Thanks

 

Liphou

TOPICS
Scripting

Views

191

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jun 21, 2021 Jun 21, 2021
Ok. Got it. It should be the right indent tab followed by any number of digits: var searchPattern = new RegExp( "\u0008" +"\\d+" , "g" ); lesPaginations[test01].paragraphs[0].contents.replace( searchPattern ,"" ); But as I already said: You do not change something in the target paragraph. Regards, Uwe Laubender ( ACP )

Likes

Translate

Translate
Adobe Community Professional ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Hi Liphou,

what should work in this case with exactly this special character:

lesPaginations[test01].paragraphs[0].contents.replace(/.\d+/g,"\u0008"));

 

Note: With this code you will not change the actual contents of the addressed paragraph.

You "only" return the changed contents.

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Ok. Got it. It should be the right indent tab followed by any number of digits:

var searchPattern = new RegExp( "\u0008" +"\\d+" , "g" );
lesPaginations[test01].paragraphs[0].contents.replace( searchPattern ,"" );

 

But as I already said:

You do not change something in the target paragraph.

 

Regards,
Uwe Laubender

( ACP )

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Unhappy! do not move to the original text !! 😉

Indeed, I retrieve the text to do another search in another document.

Thank you so much

 

Malheureux ! ne pas bouger au texte original !! 😉

Effectivement, je recupère le texte pour y faire une autre recherche dans un autre documents.

Merci Beaucoup

 

Liphou

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Ah. Still your TOC project…

 

Regards,
Uwe Laubender

( ACP )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

LATEST

Yes, I had a big problem on a loop and wanted to rule out this imprint in the script to reduce sources of errors.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines