GREP to find single character

I put together a GREP style inside of a paragraph style that is supposed to find all instances in the paragraph where there is one single character inside of parethesis. This is what I typed in:
(?<=\().(?-\))
and I assigned a character style that is supposed to change the character inside the parenthesis, but not the parenthesis themselves.
But it's not working. Can anyone help me with how to fix it?

For any other readers greppling with same,
(?<=\().(?=\))
[Breakdown:
(?<=x) Lookbehind string x
\(  .. which is an open parenthesis -- escaped, because it's a GREP special character
.  Any character. Any at all! Imagine that!
(?=y) Lookahead string y
\)  .. which is a closing parenthesis -- see above]

Similar Messages

  • How do I find & replace a single character?

    Am using Adobe Acrobat Pro....
    The find/replace box pull down has "Whole Words Only" checked and I cannot uncheck it.  How can I find and replace a single character throughout a document?

    That's just how it works. You can "find" anything, but you can only "replace" whole words. As soon as you click to open the "replace" section of the dialog the search settings are locked into their basic states, even if you don't enter a replacement string (but that part's a bug).
    The simple answer is that you cannot replace all instances of one character using Acrobat's inbuilt tools. You're expected to edit the document outside of PDF and recreate it.

  • Using Grep to find/replace

    I'm trying to find out how to use GREP in find/replace to chage the formatting of some text that comes in from a spreadsheet.
    I worked out the GREP query "~b(\d\d)~b", which finds a paragraph return, followed by two digits, followed by another paragraph return
    and then it is replaced by "\t $1~b", which is a tab, the two found digits and a para return.
    What i need to do is to amend the query to find ANY number of digits, (which may be comma delimited: eg 23, 36, 48 ,50), and then replace with a tab + found text.
    I suppose what I'm looking for is a way for the query to find "any text between two paragraph returns, no matter what tthe length", but I don't know how to do this.All the Wildcard options seem to find just one exampler (one digit, one character etc)

    And you came so far
    The operators for repeat are ? (zero or once), * (zero or more) and + (once or more). You can also specify exact numbers: {at least,up to}.
    All of these operators are "greedy" by default -- they will match as much as possible. To match as least as possible (which I'm sure you'll come up against, sooner or later), add another ? after the repeat expression.
    So this will find one digit, then optionally another (which will always be included):
    \d\d?
    and this one digit, then zero or as much as ten million million zillion:
    \d\d*
    which is functionally the same as
    \d+
    And this will find between 3 and 8 digits but will forced to use the shortest possible match:
    \d{3,8}?
    That said: A quick & dirty solution for your actual problem is to find any amount of digits, spaces, and comma's:
    ~b[\d, ]+~b
    (we need the plus here because otherwise it would also match an empty line). The [..] brackets an Inclusive list --- it will match any of the single codes inside.
    A more complicated but 'neater' way is to search very specifically only for number, comma, space, number sequences -- it's neater because that way malformed lines (comma without a space) will be skipped!
    (It also introduces another code -- the parentheses operators. Look them up in a good GREP reference --lost of people are enthousiastic about Peter Kahrel's O'Reilly title, because it's about using GREP in InDesign.)
    ~b\d+(, \d+)*~b

  • Grep to find double dot

    Hi,
    Any one can help me to find double dot in a indesign document.
    It should not catch triple dot(...) and six dots(......) match

    Here's a screen shot:
    I colored single dots blue, and the single-character ellipsis red. I've placed them in several combinations. When I run the GREP, here's what it finds:
    As you can see, it only found the single dots, and not the ellipses. Are you saying that you have actual ellipses and single dots, but it isn't finding the single dots when they are after an ellipsis?

  • LSMW SEL_DATE filed Single - Character Flag

    Dear gurus
    i created a lsmw for T/code VK12 . I faced problem when the LSMW read till convert data.
    In the VK12 , this Screen Field SEL_DATE will be my valid on date. I created the source filed Valid on date to match the mapping with SEL_DATE.
    Here are my example of data:
    SEL_DATE : 12022009
    VALID_ON : 12022009 ( read from my text file)
    the recording , mappings and source fields are created perfectly. Even read data display , the record able to shows out accordingly. But when comes to convert data , SEL_DATE return to me 1 Field Length.
    Now i feel so puzzled, why this happen?
    After some checking find out that this particular field SEL_DATE is a "SINGLE-CHARACTER FLAG"
    expert out there, do you have any suggestions or guidance? i really need this field as to identify my record.
    Without valid on date i can't call out the specific record and update it using LSMW
    thanks
    Wilson Low

    HI all,
    I recently have the same problem. With the help of other forum post, I was able to solve this problem in this way:
    1. Export the lsmw project (Extras->Export Projects) to a file.
    2. Edit the exported file and search for SEL_DATE field. Edit the last column in the right and change:
    000001000002000001CHARC to 000001000002000010CHARC
    3. Import the project using the modified file (Extras->Import Projects).
    Problem solved.
    Cheers.

  • Grep to find first occurrence of a particular word in a story

    Hello Grepers
    I haven't had luck working out a Grep to find first / last occurrence of a particular word in a story.
    To find the first occurrence of the word hello in a paragraph I would use this grep.
    (Hello(?!=Hello*$))
    For the last this works.
    ((?=Hello(?=.*Hello)))|(Hello(?!=Hello*$))
    I have tried single line and multiline prefixes but they don't do the trick.
    Waiting in suspence,
    Trevor

    Hi Marc,
    Thanks for your reply, I'm glad you got my subtle hints.
    1) First Hello in the paragraph(s)
    Marc Autret wrote:
    Also, it seems to me that the GREP patterns you've posted are wrong and only work by accident. For example:
    (Hello(?!=Hello*$))
    actually means: find 'Hello' if and only if the match is not followed by '=Hell' and 'o' zero or more times and an EOL.
    Well Marc I made a Hell of a mistake!!!
    I meant to write (Hello(?!=Hello.*$)) with a dot there which at least is not quite as stupid if not more correct.
    In fact both (Hello(?!=$)) without a . and Hello(?!=^) work, well sort of work for the first Hello of the paragraph(s) depending on the were one start the search from (before the first Hello works otherwise it will find the next "first" Hello of the paragraph.
    I said sort of because I naively presumed that GREP styles would work like GREPS, dumb hey.
    I was really looking to use these GREPS in GREP styles, well you can't.
    In a GREP style
    (Hello(?!=$)) or any of its variants will apply the style to all occurrences of Hello in the paragraph.
    I can partially circumvent this problem by adding a second GREP STYLE which applies an anti style to all words after the first Hello (?<=Hello).*
    i.e. I have a want my first Hello to be bolded then set the first style for bold and the second to regular.
    This however is not practical if one wants to auto style more than one word in this way in other words to do the same for the first Hi and the first Hello in the paragraph.
    As a regular GREP solution providing that one starts the GREP search before the first occurrence of Hello It will work.
    2 & 4) First and Last Hello in the story
    Again these GREPs don't work using GREP styles, this I think is because GREP paragraph styles only look within the one paragraph at a time they are applied to.  So they can't look at the preceding or following paragraphs to see if they contain Hello or not.
    If I am correct I see no work around to this and am will to pay 10 Pounds, Euros or Dollars to whoever comes up with a non-script fully functional  GREP styles solution for this (I think my money's safe)
    Regarding the regular non styled GREPs they nearly work as stated.
    When (?s)(Hello)(?!.*?\1) is used to find the last occurrence of Hello in the story, if the find tab is used it will firstly find the last Hello of the story then it will go back and find the one before that!! then it will go onto the next story.
    Using the GREP in script works as stated.
    The easiest way of course to find the first and last Hello in a story, document etc. by script would be
    app.findGrepPreferences.findWhat = Hello"
    myFinds = myWhatEver.findGrep();
    First occurrence   myFinds[0], last occurrence   myFinds[-1].
    HOWEVER NOT PARTICULARLY EFFICIENT!
    3) Last occurrence  of Hello in paragraph.
    This one works perfectly both with regular GREPS and GREP styles.
    In summary
    GREP STYLES: only the (Hello)(?!.*?\1) last Hello in the paragraph GREP works.
    GREP FIND TAB: the first Hello in the paragraph GREP finds the first Hello after the cursor, the first in the story works in the limited way as written, last in story has the problem of finding the second last Hello after finding the last Hello, Last in paragraph works flawlessly.
    GREP SCRIPTING: all work without problem except for the first Hello in the story that has the problem of needing to extract the last 5 letters which for my automatic text / GREP changer is a bit of a problem but for general scripting would not be problematic.
    Once again Marc thanks for your input, I doubt there's much if anything  to add on the topic maybe Laurent Tournie from indigrep.com might have some ideas.  I don't know his contact details so if you think it's a good idea please can you send him a tweet / mail.
    Regards
    Trevor

  • Is it possible to horizontally reverse a single character in a text box containing other text?

    I have a client that wants every subhead to begin with a backward character throughout the entire book. 21 chapters, roughly 4 - 5 subheadings per chapter - the reversed character will always be an R in the same font. I don't know if there's a style setting I'm overlooking, but I would very much like to be able to define it as a character style. Much thanks in advance to anyone posting useful information!

    I don't think it's possible to reverse just one character, but here is an interesting work-around. From jongware, (a frequent and helpful poster here), a script demo that you can use to make a single character font.
    Download the One-Character Demo from http://www.jongware.com/binaries/indyfont_demo.zip, unpack and copy it into your User Scripts folder. Run the script once to set up a font template, draw your custom character -- the default is a bullet --, then run the script again to convert it to an OpenType font.
    You would need to flip your letter R and convert it to outlines, then use the script to make it into a one-character font. You cant then set your subhead style to have bulleted (with your reverse R defined as the bullet).

  • Find/Change Grep only finds one instance per paragraph, where am I going wrong?

    Hi,
    I've been using a Find/Change Grep to find any price with a comma and change that comma to a thin space (Newspaper's editorial style).
    But the Grep only finds the first instance of this per paragraph.
    Sample text...
    "$200,000 $200,000 $200,000.
    text at start of paragraph $200,000
    $200,000 text at end of paragraph
    tab     $200,000."
    In the sample the grep would miss the second and third price on the first line.
    I've been using...
    Find...
    (?<=\$)(\d{3})\,?(\d{3})
    also tried (\$\d{3})\,?(\d{3})
    Change to...
    $1~<$2
    Is there anything I can add to find these last two prices?
    I've been using this in combination with Batch Find Replace script, so different greps are set up for 5,6 and 7 digit numbers that start with $.
    Thanks.

    Try this,
    Find what: (?<=\x{0024})(\d{3})\,?(\d{3})
    Change to: $1~<$2
    Vandy

  • Where to find hidden character...

    Where to find a update for this ?
    https://discussions.apple.com/thread/1899290?start=0&tstart=0
    Right now i am looking for characters like
    "SOFT HYPHEN" Unicode: U+00AD, UTF-8: C2 AD
    is there any alternative hidden charracter on a Mac ?
    I now where to find the "Character Map" on a mac and all that...,  - but how to type in a hidden character on the keyboard... ?

    You need to enable Unicode Hex Input in the Language & Text Input Sources preference pane. Also, check the box that shows the input menu in the menu bar.
    After selecting Unicode Hex Input, you can hold down the option key while keying in 00AD and you get the character.
    The other option is the Edit > Special Characters menu item. If you select the gear drop-down in the upper left corner of this panel, you can customize the left panel contents, including addition of Unicode Characters. Once you have that panel item added, you can select the Unicode character, and by double-clicking the Font Variation, it will appear at the current cursor position in your document.

  • How to copy a single character on a Q10?

    Hello forum,
    To copy text on my Q10 one needs to select a text and tap on it for a few seconds in order to get the copy icon available. However, when I want to copy a single character it doens't work because the OS thinks I'm hitting the balloon/arrow either in front or behind the selected character.
    Since there are no keyboard shortcuts for copy-pasting in OS10 I wonder how I should get this done (and I mean, just straight forward copying a single character, not a workaround)
    Thanks

    I have big fat fingers, and I didn't tap it, just touch that selected area for a second and release.
    It works.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I cannot select a single character

    I'm running Pages 5.2.2 on MacOS 10.9.4 on a 2011 MacBook Pro. The problem is I cannot select a single character with my Magic Mouse. If I try to drag over a single letter to select it, the cursor is positioned either before or after the letter. I can select and format groups of two or more characters, but not just one. It works with the trackpad though. I can select single characters with the mouse in other apps such as Word.

    While we all have MacBooks in this forum most of us don’t run Mountain Lion. There's a Mountain Lion Support Community where everybody has Mountain Lion. You should also post this question there to increase your chances of getting an answer. https://discussions.apple.com/community/mac_os/os_x_mountain_lion

  • How do I delete or edit a captured text layer that contains a single character in Cp 5?

    My captured text layer contains a single character '7'. This renders immediately when I publish the movie, but I don't get any options when I try to edit the layer by right-clicking on it.
    Can anyone help as this is very annoying...

    Hello,
    Welcome on the forum.
    Since you are talking about 'capture', I presume you are pointing to a Typing object? You cannot edit this right away. Depending on what you want to realize, could propose two workarounds:
    If you only want to show something typing (demonstration - but another text than your character), replace the Typing object by a Text Animation (right-click menu), you'll be able to edit it.
    If you want the user to type in a text, delete the Typing object and replace it by a Text Entry Box.
    Lilybiri

  • How to pass a single character to dll (as a parameter)

    How do pass a single character to dll (as a parameter). This is a third party dll that i am unable to change.
    e.g.: int functionName(char* process, char myChar);

    My apoligies, I am trying to pass a char from Teststand. Passing as a char is not one of the Category
     I tried sending (for example) : Locals.myChar[0].  Which is acceptable in C++, but gives me an error via Teststand.

  • Textarea - create String that acts like a single character

    Hi guys,
    I am trying to create a string in a textarea that acts like a single character. By this, I mean that the user cannot edit the contents of that section of text. Here's an example:
    Textarea text:
    [Number of Iterations] * 35 / 200
    I want the [Number of Iterations] to be read-only. In addition, if the user tries to delete the beginning or end of [Number of Iterations], the whole thing is deleted. If possible, I would like cursor operations to treat it like a single character as well (i.e. to go from |[Number of Iterations] to [Number of Iterations]| takes a single right button press).
    Some commercial applications like Microsoft Word do this with Automatically created text in documents (like page numbers and date stamps) and I was wondering if I could do the same thing using a Textarea.
    Any help would be greatly appreciated.
    Thanks in advance,
    Steve

    A JTextPane allows you to add components to the text pane. So you might be able to create a JLabel with your desired text and insert the label into the text pane.

  • How to make a filter in a table while giving single character

    hi,
    i have doubt in filter how to make a filter while giving single character in a table during runtime.
       if i give string like(A*) means then how it can retrive the data from the table

    look at:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60d5b593-ba83-2910-28a9-a7a7c7f5996f

Maybe you are looking for