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

GREP: four tabs to Return

New Here ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

What is the GREP code that I need that every fourth tab becomes the end of a sentence?

[Title edited for clarity by moderator: was "GREP"]

Views

414

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

Mentor , Mar 14, 2018 Mar 14, 2018

Both your screens seem identical...

whatever, this regex will pick up the every fourth tab:

Find what: ([^\t]+\t){3}[^\t]+\K\t

Change to: \r

Votes

Translate

Translate
Guide ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

for consecutives tabs without any character between them try this:

find:

(?<=\t{3})\t

change:

\r

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

If the tabs are actually consecutive, do you need GREP? Why not a simple text search for four Tabs and replace with Return?

Find: ^t^t^t^t

Replace with: ^p

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

perhaps because only the fourth tab needs to be replaced.

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

Yes, maybe.

But I was thinking maybe the tabs aren't actually consecutive as assumed in the first response. Maybe because I can't think of any scenario where I would want

"tab tab tab return"

all together at the end of a sentence, possibly forcing a new blank line.

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

now i'm wondering what 'end of a sentence' might specifically mean. four tabs becomes a full stop?

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 ,
Mar 13, 2018 Mar 13, 2018

Copy link to clipboard

Copied

Maybe  einats17068109   will come back and give us an example. There are several interpretations to this!

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
New Here ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

Hey, tab.jpg

I received a text from my client in Text without the end of a sentence.

Instead I have a number - tab - number - tab - number - tab - number -tab - number -tab.

I need that the fourth tab will be end Enter.

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
Mentor ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

Both your screens seem identical...

whatever, this regex will pick up the every fourth tab:

Find what: ([^\t]+\t){3}[^\t]+\K\t

Change to: \r

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
New Here ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

Thank you

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
Mentor ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

You're welcome.

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 ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

Hi winterm,

What's \K for? i can't find a reference for it.

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
Mentor ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

Hi,

The \K item is the variable-length lookbehind. It says "match everything before \K but don't capture it".

It was introduced in CS6.

Take a look here, from post 8, and further.

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 ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

LATEST

wow, nice. gonna have to remember that.

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
New Here ,
Mar 14, 2018 Mar 14, 2018

Copy link to clipboard

Copied

You're right,

Sorry, here it istab.jpg

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