4
GREP STYLES Find/Change or Paragraph Style (Prices) Finds: Prices with/without a dollar sign and with/without a comma Use: Apply a Spot Color to Prices for versions Find what: \$?\d+\,?\d*\.\d\d \$? May or Maynot contain a Dollar Symbol \d+ Contains a Digit, repeat One or More Times \,? \, = comma ? = Zero or More Times \d* Zero or More Times \. Contains a Decimal \d\d Contains Two Digits Part Number# Color Size Qty Price/Ea 1120669* Antique Brass 6-"L x 6-"W x 8-"H 1 ea $571.99 1120670* Bright Brass 7"L x 7"W x 8-"H 1 ea 571.99 1120671 Bright Copper 6-2/3"L x 6-2/3"W x 8-"H 1 ea 1,072.99 Part Number# Color Size Qty Price/Ea 1038092 Orange 6009 10’ Square 1 ea $3,459.99 1038092 Specify 10’ Square 1 ea 3,459.99 1150210 Specify 8’ Square 1 ea 3,323.99 James Wamser • 800-321-3136 x532 • [email protected] GREP Styles.indd 1 3/15/18 2:16 PM

GREP Styles - Ripon Printers€¦ · 4 GREP STYLES Paragraph Style: His or Her Grep Style: \bhis\b|\bher\b Sample: There is a huge house in the neighborhood with a his and her bathroom

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GREP Styles - Ripon Printers€¦ · 4 GREP STYLES Paragraph Style: His or Her Grep Style: \bhis\b|\bher\b Sample: There is a huge house in the neighborhood with a his and her bathroom

GREP STYLES

Find/Change or Paragraph Style (Prices)

Finds: Prices with/without a dollar sign and with/without a comma

Use: Apply a Spot Color to Prices for versions

Find what: \$?\d+\,?\d*\.\d\d

\$? May or Maynot contain a Dollar Symbol

\d+ Contains a Digit, repeat One or More Times

\,? \, = comma ? = Zero or More Times

\d* Zero or More Times

\. Contains a Decimal

\d\d Contains Two Digits

Part Number# Color Size Qty Price/Ea1120669* Antique Brass 6-1/2"L x 6-1/2"W x 8-1/2"H 1 ea $571.991120670* Bright Brass 7"L x 7"W x 8-1/2"H 1 ea 571.991120671≈ Bright Copper 6-2/3"L x 6-2/3"W x 8-1/2"H 1 ea 1,072.99

Part Number# Color Size Qty Price/Ea1038092 Orange 6009 10’ Square 1 ea $3,459.991038092 Specify 10’ Square 1 ea 3,459.991150210 Specify 8’ Square 1 ea 3,323.99

James Wamser • 800-321-3136 x532 • [email protected]

GREP Styles.indd 1 3/15/18 2:16 PM

Page 2: GREP Styles - Ripon Printers€¦ · 4 GREP STYLES Paragraph Style: His or Her Grep Style: \bhis\b|\bher\b Sample: There is a huge house in the neighborhood with a his and her bathroom

2

GREP STYLES

Find/Change and Paragraph Style (Part Numbers)

Finds: 4-6 digit numbers that may or may not include a letter

Use: Apply a Character Style to Part Numbers, then add to Index panel via a Script

Find what: \d{4,6}([\l\u]?)

\d digit

{4,6} 4-6 digits

([\l\u]?) [\l\u] = Any Letter ? = Zero or More Times

GA Straight Clamp Right Elbow Left Elbow

AWG mmPositive Negative Positive Negative Positive Negative

6 & 4 13 & 19 406304P 406304N - - - -

2 & 1 32 & 40 406301P 406301N 416301P 416301N 426301P 426301N

1/0 50 406310P 406310N 416310P 416310N 426310P 426310N

2/0 62 406320P 406320N 416320P 416320N 426320P 42632N

3/0 81 406330P 406330N 416330P 416330N 426330P 426330N

4/0 103 406340P 406340N 416340P 416340N 426340P 426340N

GREP Styles.indd 2 3/15/18 2:16 PM

Page 3: GREP Styles - Ripon Printers€¦ · 4 GREP STYLES Paragraph Style: His or Her Grep Style: \bhis\b|\bher\b Sample: There is a huge house in the neighborhood with a his and her bathroom

3

GREP STYLES

Find/Change or Paragraph / Character Style

Finds: 5 Digits (Checks for spaces before Digits)

Use: Apply a Spot Color to Part Numbers

Find what: (?<!\d )\b(\d{2})(\d{3})\b(?! \d) Change the 3 to 4 to find 6 digts, 3 to 5 to find 7 digits)

?<! Postivie Lookahead

\d Contains a Digit (for example, not a space)

\b Word Boundry

\d{2} Two Digits

\d{3} Three Digits

\b Word Boundry

?! Negative Lookahead

Examples:

12345

45 12345 87

389 784 95001

GREP Styles.indd 3 3/15/18 2:16 PM

Page 4: GREP Styles - Ripon Printers€¦ · 4 GREP STYLES Paragraph Style: His or Her Grep Style: \bhis\b|\bher\b Sample: There is a huge house in the neighborhood with a his and her bathroom

4

GREP STYLES

Paragraph Style: His or Her

Grep Style: \bhis\b|\bher\b

Sample: There is a huge house in the neighborhood with a his and her bathroom and closet. I heard her closet is so much bigger than his closet. This is one of the nicest homes I’ve seen!

Paragraph Style: Case Insensitive

Grep: (?i)\bk(?-i)ing\b

Sample: King, king, kingdom, KING

Note: If king is all lowercase or the K in King is capalized, then apply style.

Paragraph Style:

Grep: (?<=\().(?=\))

Sample: (InDesign > Preferences > General)

Paragraph Style: Select US dollars

Grep: \d+\.\d\d or \$\d+?\.\d\d or \$\d+\,\d*\.\d\d

Sample: 24.95 or $24.95 or $3,144.50

Paragraph Style: Select US dollars + the Parentheses and text contained within

Grep: \$\d+?.\d\d \(.+?\)

Sample: $49.95 ($1.06/mo**)

Paragraph Style: Change to fractions

Grep: \d+/\d+

Sample: 1/8 to 1/8

GREP Styles.indd 4 3/15/18 2:16 PM