GREP search: match between character styles

I fight with it, even if it sounds very simple.

In a huge document, I need to find each space with these two features:

(1) the space has no model of applied character

(2) the space located between text1 and text2 which have the style applied X character.

In other words:

< text1 [Character Style X] > < space [Character Style None] > < Text2 [Character Style X] >

How would you do that?

The reason why you are struggling is that GREP can match two specified character styles, or two specified paragraph styles in the same time. This will require script.

Tags: InDesign

Similar Questions

  • How to use GREP to apply the character style just for the first and the second line of the paragraph?

    as the title, I just want to ask how to apply the style of character just for the 1st and 2nd line of the paragraph. Help me pls, tks!

    Can you show the screen shot with the invisible market, looks like you feedback after each line.

    So, something like this would work where I have a return forced for the linebreak (shift + return). The example on the right does not work because the line break is a return:

  • GREP style - apply character style to the opening and closing parentheses surrounding a 0 (but not 0)

    Hello

    I'm relatively new to GREP style and will have to put in shape about 600 postcards containing various data (via the merger of data), including phone numbers. Consider the following data set:

    1. + 44 (0) 123467800

    2 (©) copyright

    3. (name of the program)

    I want to tell Indesign to stagger the opening and the closing parenthesis of the baseline (with a character style), but only the bracket that include a 0 and, possibly, without affecting the 0 value between them.

    Seems like an easy task, but it is impossible to find a solution. Could someone help?

    Thank you very much

    Antonio

  • Problem with GREP search styles

    Hello

    Here's a script that finds all one to three digits and then selects only those numbers that are in exponent or use the style police by exposing open type.

    This works if I'm looking for just any of these styles, but not both at the same time. When I use the script as written below to find the Exhibitor open Type or by exposing that he finds all the numbers. Why is this happening?

    In addition, I built the script that filters all the figures for these styles, because I couldn't see how I could create a script that uses GREP itself searching for character styles.

    Any help would be appreciated.

    Thank you

    Tom

    myDoc var = app.activeDocument;
    table below is all the figure of one to three words.
    Notes end var = theGrepFinder (myDoc, "\\d {1,3}");
    Here is a filter to get only those who are exposing (1936749411) or use SuperScripted (1884247155) of open Type.
    var arrFiltered = [];
    for (var a = 0; endNotes.length > a; a ++) {}
    If (end notes [a] .position == 1936749411 |) {1884247155)
    arrFiltered.push (endNotes [a]).
    } / / end if
    } //end for
    Endnotes = arrFiltered;

    functions *.
    function theGrepFinder (docRef, grepFindIt) {}
    app.findGrepPreferences = NothingEnum.NOTHING;
    app.changeGrepPreferences = NothingEnum.NOTHING;
    app.findGrepPreferences.findWhat = grepFindIt;
    var arrGrepFindIt = myDoc.findGrep ();
    Return arrGrepFindIt;
    } //end theGrepFinder

    I think that your test should be formulated as follows:

    If ((notes de fin [une].position == 1936749411) |) (notes de fin [une].position == 1884247155))

    As JavaScript OR is inclusive, this test passes if both parties are met.

    Peter

  • GREP - search for anything except a single character

    Trying to figure out whether or not I can tell GREP...

    I want to search for any character who is a character Exhibitor style except for the symbols of the registration mark.  Is it possible to exclude a character of a search?

    Thank you, Phyllis

    Altogether. Don't forget the ' ^' character that indicates "start of the paragraph? Well well... whoever designed the GREP apparently ran out of useful characters, because it is reused in the group 'exclude '. It works like this:

    [0-9fuzzy]

    looking for a unique character in the series of '0' to '9' (inclusive), 'f', 'u', 'z' or 'y '. Throw in the hat cancels the query:

    [^ 0-9fuzzy]

    looking for any old character unique except those in the game.

    The registered mark has a shortcut of its own to the regular find-^ r - so it's probably "~ r" GREP mode. Otherwise, copy and paste your text. Your GREP search must therefore (with setting shaped exposing)

    [^~r]

    It is only the following character unregistered; to search for longer strings, you can safely use

    [^~r]+

    -which translates by "any string superscript, a character or more and containing not the mark registered. Yes, the short version is a little easier to type.

  • Use GREP to apply paragraph styles, character styles not only

    I have a body of text, and in it, I would like to apply a specific style to the paragraphs corresponding to a model. I did a GREP style that applied some changes formatting of paragraphs, I tried that it affects, but in doing so, I found that I couldn't Center these lines using a character style. (The corresponding lines should be centered, and the rest should be left aligned.)

    I was thrilled to learn that the GREP function, then completely disappointed with this limitation. InDesign offers the possibility to automate this, so I must not cross and Center each paragraph corresponding to the hand?

    Thank you!

    InDesign provides a way to automate this so?

    Yes and no. There is no dynamically linked paragraph styles to a paragraph about his boss, but he has at least two alternatives:

    (1) use Grep-F/C

    (2) use the script FindChangeByList or MultiFindChange which is basically automate operations F/C

    HTH

    Loïc

  • CS3: GREP find/change with the character Style?

    Hello

    Was surfing autour through various resources, but have not been able to understand how / if possible...

    Basically, all along of a wide catalogue, there are a lot of situations with lines of text like this:

    CF2 = Double caramel icing

    and I want to look for this string and apply a character style to just the "CF2" who will be "BOLD".

    Is this possible?

    Thank you!

    Andrew

    Search

    \bCF2 (? == double caramel icing)

    Put your character style "BOLD" in the field of formatting to replace.

    Change all.

  • Question in GREP re: character style

    I'm trying to take a block of text and change everything in this text to a certain style of character. What is the correct expression GREP to do that? I know I could just strong of the text in question and apply the style of character, but I need to use it in a script of FindChangeByList, so I need to do it using GREP expressions. Thank you.

    JoJo Jenkins wrote:

    I am trying to build scripts that automate this for me, but maybe there's a much easier way to think about this issue.

    He is a. Select all of the text before you start styling and choose the character Style [no]. Alternatively, you can apply all of your paragraph styles, and then select all of your text and choose clear overrides from the paragraph Style dropdown.

    To get the default character style to be [none], make sure your cursor is selected, and then choose [none]. That applies to all future documents, make this change WITHOUT documentation open.

    Hope that helps,
    Matt

  • Need to search and apply a character style sheet

    I have a directory with the name and address of the student. I need to find 2 returns and replace with 2 returns, apply the character style, back. Here is a screenshot so you can see what I mean screen.

    [Picture with private information removed by Moderator]

    Allen, Davis must be condensed ital "BOLD" like Ahmed, Ehsan is above. Any help appreciated.

    Post edited by: Peter Spier

    Right. I have the impression that there is. As always... may be wrong.

  • GREP search for all characters

    (Indesign CS6, Windows 7)

    For a book that I'm layout, the author marked text that should be indented like this:

    [indent]

    < paragraph >

    < paragraph >

    ...

    [indent]

    (Of course, in an ideal world, the Publisher would have charged the author simply use a word for this function.)

    I made a for the text indented paragraph style. I wanted to replace it in one shot, GREP search:

    (\[indent\]) ([.| \s|\r]+) (\[/indent\]) the middle part meaning one or more (+) of any character (.) or space or paragraph return. Replace it with:

    $2 and the paragraph style (getting rid of the markers at the same time).

    Nothing has been found. I changed it to (\[indent\])([\w|\s|\r]+) (without the end marker [indent], to see what would happen) and now he found something - but stop at the first mark of punctuation (only reaching no not the end marker). So I tried to fill in punctuation: (\[indent\)] ([\w|\.|-, |: | \s|\r]+]) and each time more was found (by the way,------. here means a complete stop). If it works more or less.

    The problem is, is a technical manual and most equations etc are in the text that should be indented, so there are a lot of characters who are neither letter or number. And of course you can not call it a clean solution.

    It's the kind of string search and replace I would also use on many other projects. Does anyone know a better solution? Now, 'any character' doesn't seem to work, there at - it a code for "any character being not not a letter or number? Thanks in advance.

    Try (? s)(\[indent\]\r?) (.+?) (\[/indent\]\r?)

    The (? s) runs on single line mode so it can be found through several paragraphs and the (. +?) is the shortes match between the tags. I've included returns after the tags, if there has, based on your example that the tags are separate paragraphs. If they are at the end of the paragraph that you want to keep, remove the \r? to avoid losing the paragraph breaks.

  • Looking for the last element of a string defined in a specific character style

    I should find each space which is the last character of a string in a particular character style. For example, in the "123 456 789" passage (the underlined part here indicating a passage located in a specific character style), my ideal GREP search would produce a match after the number 6.

    How to do this?

    Define your character style in the Format Panel find, use this GREP: \s$

    $ is the match end-of-string location, and when you search for text in a style character style, the end of what this style is applied to is considered the end of the string.

    Peter

  • CS3: need script to replace spaces with underscores in the paragraph and character style names

    Help! I am very new to scripting.

    I managed to find and tweak existing javascripts to search through all my paragraph styles to disable hyphenation and off balance the jagged lines, but I need help with this one.

    I work on Mac OS 10.4.11 using Indesign CS3.

    I need a script that will search all my paragraph and character styles in my open Active document and replace spaces by underscores.

    Can someone help me with this? It would be greatly appreciated!

    1. I don't know, but I think you can use all the regular GREP inside this function codes. Do not use the quotation marks around of the expression, use slashes! (Why? Just a curiosity of Javascript... maybe a hack that goes back to the gray mist of JS development...)

    This work should - but rather the code above, this is not tested:

    .. Replace (/ [-\ / ()-. _] + / g. '_');

    The GOLD group inbetween the brackets contain all the characters you want to replace with an underscore: the hyphen (this has to be the first character in the group, else it will be interpreted as a range of characters from each side!), space, slash (this one is 'special' inside the function replace JavaScript, so I think he needs to escape with a backslash)! in parentheses, a period (not sure if it should escape - into ordinary GREP, it's the wildcard character for any character, but maybe he loses his magic within a group of GOLD) and finally... the underscore character. Why?

    Well, this replacement string comes with a free bonus. Note the sign after the installment of GOLD +. This means that a whole sequence of these characters is replaced by a simple underscore: "it's / a - / test" will become "This_is_a_test". Adding the underscore line itself to the string of research means that it will also find the whole chain 'space space (stroke underscore)' in 'This style (_)' and, oh magic!, replace it immediately with a single underscore.

    Just FYI, the tiny "g" after the closing slash is abbreviation of 'global', i.e. at the global level, replacing in this string. replace the default values for a replacement only (why? see above...), and adding the 'g' ensures he keeps replacing until it is not find matches more.

    2 see point 1.

    3. uh, yes it's true, but you will need to check very carefully if nothing inside one of these basic models is substituted. You can apply a base style and add substitutions to make look like a subtitle, but that isn't making it a. And to the next paragraph, you can apply a base style and add substitutions to make it look like a paragraph of plain text (etc.). It's a signature of witness to bad formatting...

  • Character styles do not work in Pages

    I'm on a MacBook Pro (13-inch, mid-2014, retina), running 10.10.5 (14F1021) and run pages v. 5.6.1

    It's pretty simple: I'm searching the internet apple documentation and Web sites.

    To the title of the pane 'format' to the right of the workspace, there is an option below 'police' called 'Styles of character ".  There is no way, in this latest version, to create a new character style.  No selection there will allow you to press the symbol '+', and there is no menu in the menu bar you option to create a character style.

    Despite trying several ways of dozens to understand this point, there is no work around.  I think it's a bug.

    Please fix this Apple?  I love the pages, but boy, this can be frustrating.

    Thank you!

    I use Pages on El Capitan 10.11.1 v5.6.1. I can define a character style.

    Try the following:

    1. Type a word or two. Select them.
    2. Press command + T to launch the Panel font
    3. In the toolbar, click the selector bar and in this menu, choose color
      1. Choose red
      2. Unique, choose the menu bar (you now have a single, red strikethrough)
    4. Selected always your text
      1. Click Character Styles picker
      2. The + symbol is now blue
        1. Click on + to add
        2. Change the new name of red bar, then press return to set.
      3. Click on any character Style
      4. Click the character crossed Red style to test.

    If you want any style of character custom for later use, you will need to make a custom template for new documents, or simply a model of style that you can open separately and then using the Format menu, styles of copy/paste between your model as well as the current document.

  • Application of large amount of copy character styles

    Hello!

    I am trying to apply character Styles to a large amount of copy and I can't understand it. I find tutorials on how to create them and use them, but I don't want to have to search all my text to style "italic". I hope that all makes sense. I thought that there was a way to apply a character Style to the text easily, but I can find no longer.

    I want to apply a character Style to some words in a large amount of text, and then apply Styles to a paragraph in the text box. actually not to change Styles of character to the breast.

    Does anyone know how to do this? Looks like it should be so simple!

    Thanks in advance!

    L.

    Is already italic text? If it is you can do a find/change GREP for. + and set the Format to find for italics, and then set the format change on your italic character style and change all. You should do this on a copy of the doc for safety.

  • The different paragraph of distinct character style formatting

    Hello

    In my paper, I have bunch of paragraphs and each begins with the name (two or three words). Character style is applied to each name. Now, I want to add the paragraph after each name of each mark is so in its own paragraph. Of course, I can do it manually, hitting enter after each name, but I was wondering if there is a more efficient way through search/replace or perhaps GREP.

    Thank you!

    m

    Try this on a copy to be sure, but I think finding ^. + and set the format to find the character style, and then change to $0, you can also set the change of any character Style Format and a new paragraph Style that is applied by the character style formatting.

    This will probably leave you with a space at the end of the paragraph, or the beginning of the next. The location will depend on if the style is applied to the space. If this is the end of the paragraph, you can use find find ^(.+) (\s) and change to $1

    If it's at the beginning of the next paragraph, in my opinion, you need a second query, Find ^ /s (leave find it empty format or the value initially attributed the paragraph style) and do not fill the field exchange.

Maybe you are looking for

  • All calls fail

    For these last days were not all calls that I tried to send, and I can't receive calls. Messaging still works. I can press the call button, but it won't ring, even to the sound echo test. I have the latest version of Skype and Windows updates. I have

  • iMac9, 1 &amp; large SSD not compatible?

    Tried upgrading the iMac9, 1 (early 2009) with a Sandisk Ulta II 960 GB SSD. It is a SATA III SSD. Finished with a white screen on startup. Absolutely boot with this hard drive (internal or external). I have test the background and even SSD installed

  • HOW DO GET YOU A CD FOR M9040N PLAYER DRIVE DISABLED

    I HAVE LOST THE USE OF MY CD PLAYER AND WOULD LIKE TO DO WORK AGAIN

  • Satellite A200-1UM - prohibitions of departure and not possible formatting

    Hi all At first, I want to apologize if my English is not so well and maybe a little hurt. I have a Toshiba Satellite A200-1UM Cristmas 2007 and until now I never had big problems with it, but now, I got a huge.Yesterday, when I came back from school

  • Analysis of the network strategy and how they really work

    While I have read in the Doc user Sourcefire I'm starting to get confused about the effective implementation of strategies of network analysis. So I know that you can choose a strategy analysis by default through policy to access control in the Advan