• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[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

466

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

Community Expert , 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 )

 

 

Votes

Translate

Translate
Community Expert ,
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 )

Votes

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
Community Expert ,
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 )

 

 

Votes

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

Votes

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
Community Expert ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Ah. Still your TOC project…

 

Regards,
Uwe Laubender

( ACP )

Votes

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.

Votes

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