In my GREP style I want it to find a different / (forward slash) in glyph set

Hello!
I have a GREP style that I have been using to find fractions and it works fine.
The issue now, is we are not going to be using the standard / in the glyph set, but a different one. It's a unique one built into the font.
This is the part of the GREP style I have that finds the /
(?<=\d)/(?=\d)
Now, I need to replace the symbol between the 2 sets of parenthesis, the thing its actually applying a character style too, to a unique looking symbol in the glyph set, but I don't know how to replace it. I tried to copy and paste it, but it did not work.
Is there a way to tell a GREP Style to look for a GLYPH's GID or UNICODE number?
So, it might look more like this:
(?<=\d)GID217(?=\d)
thanks
babs

Hi Peter!
OK-that does work. Took me a bit, but I got it.
Problem now is,  I then also had to switch the / for the Unicode one for the numerator and denominator GREP style part. I almost have it, but for some reason, the slash is saying its using a mixed style (you know, when you select something, one character in a GREP style, but in the character panel, it tells you at the bottom wihch one its using). This now says mixes instead of slash for the character style name, and isn't correct.
Can you see what might be wrong in this snapshot?
thanks so much!!!!
babs

Similar Messages

  • Grep style: identify the letter l first in a paragraph

    Grep style: I want to add a character style to the letter l, but only if it is the first character in a paragraph and the next character is a single space. Basically, I would like to change the font to zapf dingbats, but only for the letter l when it is the first character  in a paragraph. This will generate a bullet character as first letter. has anyone any idea how this grep search should be? The query should look for the letter l and a single space first in a paragraph!

    The GREP for this would be:
    1. Start of paragraph: ^
    2. Followed by a single letter "l": l
    3. A positive lookahead for a single space: (?= )
    ^l(?= )
    Uwe

  • Create a GREP-Style with script? [AS] [CS4]

    Hi
    I'm trying to ad a grep-style to a paragraph style.
    It's easy to read/write properties from one that already exists but how can I create a new one?
    This is in applescript, CS4
    rgds /Mattias

    Yep, know about Nested Grep Style.
    In AS it:s http://www.indesignscriptingreference.com/CS4/AppleScript/nested-grep-style.htm
    If I have a P-style in a document, with a nested grep style applied. I can read and write to that grep style by calling it:
    nested grep style 1 of paragraph style "myParaStyle"
    read: grep expression of ... -- -- -- -- -- -- -- Where ... is the above line
    write: set grep expression of ... to "xyz"
    However, if the P-style doesn't have a nested grep style applied, I can't find a way to create/insert one into the P-style.

  • [AS] How to change a paragraph style within any folder in Find Grep?

    I want to change both text and paragraph style
    I do that job very easily until I put paragraph styles in a folder
    How to express the paragraph style "passage" within the folder "1st" in AppleScript?
    In line 18 below, "1st:passage" may be wrong... so I've tried and search for an hour, but I can't get the answer..
    sorry for bad english
    my main()
    on main()
      mySnippet_test()
      myTeardown()
    end main
    on mySnippet_test()
              tell application "Adobe InDesign CS5.5"
                        set myDocument to document 1
                        set find grep preferences to nothing
                        set change grep preferences to nothing
                        set include footnotes of find change grep options to false
                        set include hidden layers of find change grep options to false
                        set include locked layers for find of find change grep options to false
                        set include locked stories for find of find change grep options to false
                        set include master pages of find change grep options to false
                        set find what of find grep preferences to "\\n"
                        set change to of change grep preferences to "\\r"
                        set applied paragraph style of change grep preferences to "1st:passage"
                        tell myDocument
      change grep
                        end tell
      --Clear the find/change preferences after the search.
                        set find grep preferences to nothing
                        set change grep preferences to nothing
              end tell
    end mySnippet_test
    on myTeardown()
    end myTeardown

    Replace the red line with… Replacing name strings to yours…
    set myStyle to paragraph style "Style A" of paragraph style group "Style Group 1" of myDocument
    set applied paragraph style of change grep preferences to myStyle

  • IDCS5/MAC - GREP Style to uppercase a letter after a dash between words

    G'day there.
    I'm trying to create a GREP style to uppercase a letter after a dash between words, more specifically where one word starts with a capital and the one after a dash does not e.g. Lorem-ipsum = Lorem-Ipsum
    The full story is that there is a standing indesign file used over and over again which data-merges surnames which are in a massive database. The data arrives in uppercase and our mail barcoding software allows us to Title Case certain fields, but the Title Case behaviour has the following results:
    * McLeod = Mcleod
    * D'Agostino = D'agostino
    * Smith-Bunting = Smith-bunting
    i've been able to solve the McLeod = Mcleod problem with the following GREP style:
    (?<=Mc)\l
    and then apply a character style which is nothing more than All Caps.
    similarly, i've been able to solve the D'Agostino = D'agostino problem:
    (?<=\u')\l
    and once again apply the All Caps style to the affected letter. This also solves the O'leary problem to O'Leary.
    However, when I try these GREPs to grab the Smith-bunting style issues:
    (?<=\u\l+?-)\l     or   (?<=\u\l{2,}-)\l
    the search won't work, nor will it work with regular Find/Change GREP replace... yet the expression \u\l+?-\l will find the block that i'm after.
    I could use the search
    (?<=\l-)\l
    and this will find Smith-bunting = Smith-Bunting... but will also find co-operate = co-Operate (will find two words joined with a dash but  starts with a lower case letter).
    This is fine if the para style is applied to the  line in the address block containing the client's name, but if the name is referred to in a block of text, then that block of text has to have the para style with the GREP style applied, and any dashes between words in that para behave the same way as the name.
    yes, it is possible to go into excel and use the =PROPER(affected cell) and fix the Smith-Bunting fields, but i'm trying to create a solution which will work solely in InDesign so that other operators in the office (who aren't familiar with excel) can simply open the standing file and dump in the txt database generated by the mail barcoding software.
    there are other names that the mail barcoding's title-case fouls up i.e.
    * MacLeod = Macleod
    * van der Graaf = Van Der Graaf
    * van Diemen = Van Diemen
    but a GREP to make Macleod become MacLeod may foul up Mack, Mackie or Macy to become MacK, MacKie or MacY.
    I also know that a GREP for the van der or van won't work as the style will only force letters to become All Caps, not uppercase to lower...
    Ultimately...
    does anyone know a way to GREP style (not a find/change GREP) a fix for Xxxxx-xxxxx = Xxxxx-Xxxxx?
    Colly
    Colecandoo.

    I agree with Haakenlid on his Dirty-Workaround view -- I feel data should be entered the way it oguht to, not altered by some magic GREP styling -- but then again I can also sympathize with your POV re: a fire-and-forget solution even your dumbest operator can't miss.
    Oh the rigors of life.
    If you are totally, absolutely certain you want to do this by GREP, use this:
    (a) Set a To Capitals character style to the string
    \b\u\l+\-\l
    -- this will magically transform "Hon. Lt. Sir John Forsythe Blunt-object" into "BLUNT-Object".
    (b) Then override ( ! ) the first half again with another character style that removes the To Capitals attribute ( ! ):
    \b\u\l+-(?=\l)
    Notice how this expression is exactly the same as the above one, except for the very last code -- the next lowercase must also be caught, but now using a lookahead so its formatting won't be affected.
    This removes the All Caps override from the first halve, changing it from "BLUNT-Object" back to "Blunt-Object".
    Lots of side effects, I'm sure. Perhaps it is safer to teach your operators to run a single script.

  • How can I apply a GREP style to a text variable?

    Hello everybody,
    I have a question concerning GREP styles inside Paragraph styles.
    1. I've created a text variable to generate a recurring title on the upper side of the page based on the main title paragraph style;
    2. The recurring title is in Adobe Garamond Small Caps, all letters in lower case, and it is formatted with a paragraph style sheet in the master page;
    3. I want to create a GREP style for the recurring title, according to which every time that in the recurring title appear an apostrophe or the double quotes, they are automatically lowered 2pt on the baseline
    (I already created the character style sheet that lowers letters of 2pt).
    What I need is the correct GREP formula to automatically apply the character style sheet to apostrophes and double quotes, in the line of text generated by the text variable...
    Thanks for your  help
    p.

    Hi,
    As I said, using Power Headers is the best way to do it.
    As Power Headers treats the header as "live text", you can use a simple grep style inserted in the header para style:
    … to obtain:
    For the sample, I use a char style named "-2pts" with Shift -5 pts and Green color to show you the place of ' and ".
    Don't forget that, even Power Headers treats the header as "live text", you only have to update Power Headers to make an update of the headers! 
    Even I use in another cases Tomaxxi's [JS] and it's a good way to treat the question, Jean-Claude Tremblay's solution is less interesting because the variable used is converted in text. If the variable text content changes, it's more complicated to manage the update!

  • Why doesn't Grep Styles with pos lookbehind work?

    Hi,
    I've posted another thread but I suppose I expected too much. I'll try to siplify this.
    I have text where I want to catch underlined text:
    Ponny, - Cob…….499,-
    125, - 135, - 145, - 155…….399,-
    140, - 150, - 160, - 170……..99,-
    140, - 150………99,-
    This paragraph grep style works for the above:      ^\w+,\s-\s
    However, when I want to use positive look-behind to just catch the " - " it stops working.
    I have tried the following (none of them catches anything at all):
    ^(?<=\w+,)\s-\s
    (?<=^\w+,)\s-\s
    (?<=\w+,)\s-\s
    Is there a limitation as to what syntax I can use in the lookbehind?
    Pointers anyone?
    /K

    Hi Eugene,
    Lookaheads and Lookbehinds don't work when using the repeat codes, like "+" or "*" or "?" etc.
    I guessed there might be a limitation as to what works.
    Eugene Tyson wrote:
    Can you search for
    \s-\s
    And only search for underlined text in the
    Find Format
    area
    No, sorry. The underline was olnly to indicate what I was trying to grep...
    I don't want to use find-replace. I want to use the paragraph grep style.
    /K

  • GREP styles vs style sheets

    I've got a lull at work and decided to work on my list and start to learn GREP so that I can use GREP styles.
    The first one is a simple one:  [[A-Z][A-Z]\S+?] This finds anything inside the brackets that starts with two capital letters. I know it works because I can find "[MT2]" in Find/Change.
    OK, so I try it in some ID cs5 text with my first GREP style. It's failing the vast majority of the time. So I try lots of different things to see if I can find a pattern of what works and what doesn't. I've tried just the local formatting of a lone 'graf. I've tried making character and 'graf style sheets that incorporate a GREP style with the new character style, say "change type color to green".
    I've looked through the forums and don't see others with my problem so it must be something about me or my document. I've used other documents to eliminate that variable. I've gone through the tutorials and David Blatner's stuff and don't see anything I'm doing differently.
    When I format some text with a character and 'graf style sheet, it fails. BUT when I change the character style sheet of the source text to "[None]" it works. I've tried starting with text that is '[None]' and a 'graf style sheet of Normal, it works.
    But starting with text styled with '[None]' character and a formal 'graf style sheet with a GREP Style, it fails. But when I change the 'graf style sheet to ]'Basic Paragraph]' it works.
    I'm trying to find a pattern here, so to speak, and the only thing that has a chance to succeed is setting the character style sheet to 'None.' I just don't see than anyone who uses GREP styles has any problems like I do.
    What do you reckon I'm overlooking? I've spent today trying to find what works and doesn't. As it is, I can't recommend this to my co-workers.

    Rule of thumb for applying styles is basic formats for the entire paragraph should be defined in the paragraph style. If some selected bit of text needs to be formatted differnently, then you apply a character style (or, if you must, a local formatting override). With Nested Styles and GREP styles, ID has very powerful tools for applying character styles to selected text WITHIN the confines of the paragraph style definition. Most programs don't have that capability.
    Should you apply the character syle as a nested or GREP style, or perhaps through Find/Change, or just by manually selecting text and applying the style? The answer to that will depend on a few variables. Should the particular string ALWAYS have a particular set of attributes, no matter what? Find/Change or local selection is the way to go. Character styles applied that way will survive even if the underlying paragraph style is changed to match the character style, then changed again. If the style should be applied to a string in a particular position in a paragraph, even if that position might move around a bit, a nested style is probably the way to go. If you want to make changes to text that matches a particular pattern, wherever it falls, when the surrounding text is a particular style, a GREP style is the answer.
    GREP styles are very powerful, but they also use far more in terms of resources than applying a character style using other methods. I've seen reoprts of ID getting bogged down by too many GREP styles.

  • Indesign Grep style question

    Hello,
    I have a question about Indesign. I want to make the text after a certain character like a hair space for instance bold. This must be set in a paragraph style. I think this can be done with GREP styles. I have tried several things but it doesn't make sense to me.. Does anybody know if this can be done or is there a better way to do this?
    Thanks!

    Apply 'bold' character style to text:
    (?<=~|).

  • Attempting to create a GREP Style

    I'm trying to make a GREP style for one of my paragraph styles, that will take the text from the beginning of a line until a colon and set a character style to it to bold that part.
    Example:
    Step 1: Take bread
    Step 2: Take peanut butter
    Step 3: Spread peanut butter on bread
    I don't think I've been getting the syntax right.  I've put ^\:~h and ^:~h into the 'to text' box, thinking this meant "Beginning of line until the character ':' and end" but neither of those have given me the results I want.  Thanks in advance for the help!

    Prismatus wrote:
    Your response worked for me.  I had tried using a wildcard before the ones I posted, but only put the . in, assuming it would cover more than just one character.  I assume the +? covers all characters until the colon shows up, yes?
    No, it's slightly more complicated than that (sorry!). By default, GREP is Greedy -- that means, if you use this
    ^.+:
    GREP will think that the Any Character wildcard may be repeated as much as possible (that's the '+') before it needs to match the colon. What this means is that it will work just as you expected for
    Step 1: This is a single line.
    but will go out of its mind with this
    Step 2: what will happen now? Well, contrary to what you were expecting, the entire line will be marked bold, all because everything up to the very last : will be matched!
    The bold bits accurately shows what happens! Another example would be this:
    \d+
    which for a string of "123" will not match just the first digit, then the second, then the third, but all of them in a single long go. By default, GREP will grab as much as it possibly can.
    Adding a question mark behind the "Repeat Me" character reverts this behavior to Non-Greedy behavior, and as such GREP will match as little as humanly possible:
    \d+?
    will then match just the "1" in "123".
    Prismatus wrote:
    I also like the be literal part, but I was wondering what you would have instead of \d if you had more than nine steps, or if you had substeps (1a, 1b, etc.).
    That's just a case of adding more specifiers. To match one or more digits, you need this:
    ^Step \d+:
    The '+', again, will allow a repetition of the "digit" code. In this case you don't have to add a question mark, because there is no way this could run out of control; first, it will only match digits, and second, these digits must be followed by a colon.
    And if you may or may not have a single lowercase character following the digit (but still before the colon), you'd use the Any Lowercase Character code and the Zero or Once repetition specifier:
    ^Step \d+\l?:
    (that's a lowercase ell.) You see the question mark meaning Something Entirely Different here? It's only a Non-Greedy marker when immediately following another repetition code, one of these
    * (zero or more)
    + (once or more)
    ? (zero or once)
    {4,8} (or any other set of numbers -- this is at least 4 and at most 8 times)
    Uh, by the way, that makes this
    abc??
    a valid GREP. It will match "ab" or "abc", and then always select the shortest possible match of these two, which is then the "ab" one. ... Uh. I'm pretty sure this may be useful, some time in the future.

  • Creating a GREP style Help Needed

    I would like to set-up a style using GREP expression(s) that would do the following:
    Everything preceding an em dash (including the em dash and two spaces after the em dash) would be set to bold-italic, AND everything in the paragraph that begins with the word "NOTE:" until the end of the paragraph would be regular-italic.
    Here is a sample of the kind of text I want to format with one style:
    OPERATOR PANEL - The operator panel is located on the right-hand electrical enclosure. NOTE: Not all equipment will have the same operator panel. Refer to schematics for additional information.
    "OPERATOR PANEL - " would be all bold (or bold italic). The body text is regular. the "NOTE: Not all .... " to the end would be regular-italic.
    Any help or direction to a web-site with examples would be appreciated.
    Thanks in advance.
    RPP

    It's easier than you think.
    Peter's suggestion of a regular nesting style might work, except that it's
    i always
    applied to each paragraph you apply it to. That's just what the Grep styles are for:
    i conditional
    stuff.
    The 1st half: Apply Style: Bolded To Text: ^.*? ~=
    (there should be another space after the '=')
    The 2nd half: Apply Style: Italicized To Text: NOTE:.*$
    These are both pretty much basic GREP expressions -- except for the "~=", that's Adobe's --, so just about any google to a GREP repository can explain them. I already knew the basics, but
    this page taught me some new tricks.

  • CS5 - Grep style problems

    Where I work the treatment of the type is to reduce the size of all-caps, a string of numbers, or a combination of the two. For years they've been doing it by setting up a Character Style for each Paragraph Style (e.g., "Body smaller" for "Body), and then also alternate Character Styles if the text already has a Character Style applied to it ("Body Red Italic smaller" for "Body Red Italic"). You can imagine this quickly becomes a lot of styles.
    So I thought with CS5 Grep styles I could set this up in the Paragraph Styles. I want the Grep style to apply a Character Style that is nothing but a Horizontal and Vertical scale of 95%.
    The types of things I'm wanting Grep to find are below. But I'm only wanting to apply the style to the letters and numbers and not the punctuation.
    AAA
    B23
    33,333
    4,444,444
    U.S.A.
    (ABC-1)
    I went at writing this a piece at time, so it is not very elegant. Here's what I have:
    \d{2,}|\u{2,}|\u+\d+|\d+\u+|\d+[[:punct:]]\d+|\u+[[:punct:]]\u+|\u+[[:punct:]]\d+|\d+[[:pu nct:]]\u+
    This does a pretty good job, with a couple of problems.
    1) It is "catching" (applying the character style) to the first punctuation if there is a single character before it (e.g. the first piece of punctuation in 4,444,444 and U.S.A.)
    2) It is not always "catching" instances where there are more than three sets of numbers/caps in an item (e.g. U.S.A., it doesn't style the "A"). I know Grep is probably just doing what I'm telling it to do, but I can't see how to fix it.
    I would appreciate any help anyone could give me.
    Thanks.
    Tom

    You can't do all this in one GREP style. The one you came up with is already difficult to read, so you can imagine what happens to its readability by the time you get it to work. Apart from that I don't think it's possible to do what you want in one expression.
    So you really need to split up your task into several chunks, all of which you can then add to the same paragraph style. Your expressions may be more efficient, but they're much eaier to understand and maintain. Here goes.
    The easy ones are AAA, B23, and (ABC-1), all of which are captured by this expression:
    \(?\u[-\u\d]+\)?
    U.S.A. is more tricky, and it needs to be split in two itself. The first part captures series capital+period, but not the last one:
    \u(?=\.\u)
    Capturing the last capital+period is interesting in that it requires a negative lookahead embedded in a positive lookahead, which I wouldn't have thought was possible, but it works:
    (?<=\.)\u(?=\.(?!\u))
    For the numbers you's do something similar.
    Peter

  • Apply grep style only once

    I can't get my brain around what is probably a very simple problem: I want a paragraph style that applies boldfacing to any character up to an including the first colon in a paragraph. If I used  a nested style "through 1 :" the whole graf is bold if there is no colon. So that's out.
    A grep style ".+: " seems to work in most cases, but if there's a second colon, the boldfacing is extended to that point. What I think I want is a grep style that works "zero or 1 times" but I cannot figure out how to use the ? to make that happen.

    @Jongware – I think Robert wants to limit the GREP style to the first line of a paragraph.
    But unfortunately GREP in InDesign does not know about line endings.
    In scripting we could do something like what he wants, but comes with some obstacles, because the GREP will apply a character style, that will probably change the line ending. A very dynamic situation…
    Example 1
    Basic situation:
    This is my text here comes the colon: and
    here another one: that Robert don't like
    to take into account using the GREP style.
    Formatted after  the GREP style is applied:
    This is my text here comes the colon: and
    here another one: that Robert don't like
    to take into account using the GREP style.
    As I understand it, in case that the first colon will leave line one, only the first line should be formatted like this:
    (Case 1)
    This is my text here comes the first
    colon: and here another one: that
    Robert don't like to take into account
    using the GREP style.
    Or should it be, that the style should only be applied, if it's in the first line?
    (Case 2):
    This is my text here comes the first
    colon: and here another one: that
    Robert don't like to take into account
    using the GREP style.
    But what, if the colon in the basic case is at the end of line 1 and will be shifted to line 2 after formatting?
    What should happen then?
    That is simply not possible to format automatically (dynamically) using GREP styles in InDesign.
    Uwe

  • GREP STYLE, find/change

    Hi!
    My problem is..
    I got these numbers:
    17
    31.9
    32.9
    15
    in a table/cells. They need to have an .00 and 0 like this:
    17.00
    31.90
    32.90
    15.00
    I can use this one for that: find: .$  change: $0.00 but then the numbers with 31.9 gets the .00 also.. 31.9.00
    Any grep styles for that? multiple functions in the same style`?

    A grep style can't change text for you; it can only apply a style to text that matches whatever pattern you set.
    I don't think there any one search/replace that will get you where you want to go, but I was able to do it using two search and replace strings:
    ^\d+(?!\.)\b
    $0.00
    Finds any number of digits at the beginning of a line, that does NOT have a period following it, and returns the same number with ".00" appended.
    ^\d+\.\d\b
    $00
    Finds the remaining instances that have a period and only one digit after it, replaces it with the found text with "0" appended.
    This will not touch anything that has a number that has two digits after the period, like 12.95.
    Give it a try on a copy of your document, see if it does what you need. Depending on how your document is set up, and what other text is in it, you might also want to highlight the table (or just the relevant columns) and restrict the search to the selection rather than the whole document.

  • How to end grep styles?

    Grep styles (in Paragraph style) is one of the fabulous option in indesign CS4, but i am having one doubt that do we have any option to end grep style at any particular instant like we have "END NESTED STYLE HERE" to end nested style.

    You should state the full string to match in your GREP query. If it matches all, then all gets marked. If you don't want it to match all, you need to adjust the GREP query.
    Alternatively, if you feel you have to "prematurely end" your character style, you can use a nested style instead.

Maybe you are looking for