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

[JS] RegExp tabulation Code

Enthusiast ,
Jun 21, 2021 Jun 21, 2021

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
763
Translate
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 )

 

 

Translate
Community Expert ,
Jun 21, 2021 Jun 21, 2021

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 )

Translate
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

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 )

 

 

Translate
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

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

Translate
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

Ah. Still your TOC project…

 

Regards,
Uwe Laubender

( ACP )

Translate
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
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.

Translate
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