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

GREP query to prevent phone numbers from breaking

Explorer ,
Apr 28, 2017 Apr 28, 2017

Copy link to clipboard

Copied

Before a computer crash/replacement, I had a GREP query that made sure all phone numbers wound't hyphenate/break to another line (keeping the entire phone number together). My backup drive hasn't arrived yet and I need this query to run on a magazine (with lots of phone numbers at the ends of 400 articles). I can't remember how I created it and some of things I have tried today aren't working. I've tried searching for a GREP query online, but found nothing specific.

Can anyone give me the query to save me some time?

Views

710

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

Explorer , May 30, 2017 May 30, 2017

Yes, I figured it out.

I'm importing editorial (40 pages worth) that have phone numbers in each paragraph. These phone numbers are laid out as 206-444-1515, for example.

I created a query that replaced all the hyphens with a non-breaking hyphen and that worked (Thank you, Barb).

Votes

Translate

Translate
LEGEND ,
Apr 28, 2017 Apr 28, 2017

Copy link to clipboard

Copied

Hi,

Samples!

(^/)

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 ,
Apr 28, 2017 Apr 28, 2017

Copy link to clipboard

Copied

How, exactly, do you format the phone numbers? If you are using hyphens (i.e., 703-370-3661) you could simply swap the hyphens for non-breaking hyphens (which are not allowed at the end of a 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
Enthusiast ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Are you looking for the exact query? Or how to keep them from breaking? I generally apply a character style with No Break applied to keep them together. How are your phone numbers formatted? If you have them formatted in different ways, it'll need to be more inclusive...but let's make it as simple as it needs to be for your use.

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 ,
May 29, 2017 May 29, 2017

Copy link to clipboard

Copied

Did you ever get this figured out?

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
Explorer ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

Yes, I figured it out.

I'm importing editorial (40 pages worth) that have phone numbers in each paragraph. These phone numbers are laid out as 206-444-1515, for example.

I created a query that replaced all the hyphens with a non-breaking hyphen and that worked (Thank you, 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
LEGEND ,
May 30, 2017 May 30, 2017

Copy link to clipboard

Copied

LATEST

Hi,

Can you show us your query?

(^/)

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