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

What is the tab character in REGEX?

Community Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Hello FrameMaker friends:

 

I'm trying to find/change a series of spaces to tabs. The problem space always follows an R and four digits. For example,

R0000 followed by a space needs to be R0000 followed by a tab

 

So, this

regex.png

locates the string but adds back in as R0000t and not R0000>.

 

Looking it up, \t is the REGEX character for a tab. What am I missing?

 

TIA,

~Barb

Views

12.7K

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 , Nov 18, 2021 Nov 18, 2021

Barb, try this for your tab: \x08

Votes

Translate

Translate
Community Expert ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Barb, try this for your tab: \x08

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 ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Thank you, Rick! 😊

 

~Barb

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
Adobe Employee ,
Nov 18, 2021 Nov 18, 2021

Copy link to clipboard

Copied

Might be a bug.

This works: $1\u0008

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 ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

Hi Barb,

 

You can also copy a tab from your document and paste it into the Change field.

Then FrameMaker will replace with a tab correctly.

 

Best regards

 

Winfried

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 ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

This is a very old problem, because FM uses x08 as TAB character, whereas the ANSI definition is x09.

It may well be that \t is implemented as x09...

At least in ExtendScript RegEx \t handles the TAB character of FM correctly.

My tests in 15.0.8.979 (aka 2019) show this:

  • \t is found in text by Simple Search, Wildcards and Regular expression
  • \t is not honoured in the replacement of the RegEx  Search which is IMHO a bug

Tests in 16.0.3.979 (aka 2020) show this:

  • \t is found in text by Simple Search, Wildcards and Regular expression
  • \t is not honoured in the replacement . It is even worse: finding Question and replacing this with $1\t yields the single character t !!! I have reported this as bug 11044

Edit

From the reported bug only the part concerning handling of the TAB (\t) is correct.

Ah, I really become old: $1 requires that the find expression contains at least one group ...

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 ,
Nov 19, 2021 Nov 19, 2021

Copy link to clipboard

Copied

LATEST

Thanks, all! 😊

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