[CS3] GREP question

I am using the following code to find all compound words:
(\w\w+)-(\w\w+)
However, if the first word has initials, such as "U.S.-China," it does not find it.
So I change the code to be:
(\w(.?)\w+.?)-(\w\w+)
This works. Now GREP finds any compound word whether or not there are initials but when there are no initials it also selects the last letter of the word prior to the compound. For instance what is in brackets here is selected:
th[e mid-September]
Why is this happening and how can I fix it?
Thanks,
Tom

Tom Tomasko wrote:
[...] However, I found that following also works:
([\w+.*]+)-(\w+)
Yes it will work, and as a side effect ... it will also pick up '+' and '*' !
A list of characters inside [ Character Set brackets ] loose the magical properties they have outside them. \w is still regarded as 'any word character' (0..9, A..z, and the equivalent in other scripts), but the period does not longer match "any character" but only itself. There is no need to grab more characters using either + or * because anything inside the Character Set brackets always will match one single character, and you need the '+' right after it to get it to repeat.
So all you need is this:
([\w.]+)-(\w+)
WhatTheGrep's breakdown:
( Begin Group #1
[ Inclusion: any character in this group
  \w Any word character (A..Z, a..z, _, 0..9)
  . The character “.”
] End Inclusion Group
+ Any character in this group may occur once or more times; longest possible match will be taken
) End Group #1
- Literal character “-”
( Begin Group #2
\w+ Any word character (A..Z, a..z, _, 0..9); may occur once or more times; longest possible match will be taken
) End Group #2
(1[\w.]+1)-(2\w+2)

Similar Messages

  • Add space between set of Symbols - Grep Question

    hi everyone,
    I have another Grep question someone hopefully can help with. I need to find the following symbols in my long document < > + =      
    All these symbols need space either side of the character. I would like to setup a grep expression and have it find the symbols and add spaces either side. So far I can find each symbol but can't figure out how to add spaces before and after with the replace feature?
    find:
    =|<|>|+
    replace:
    can anyone help..
    lister

    Use this line in Find option: \+|\=|<|>
    Use this line in Replace option: <space>$0<space>
    Siva

  • Another "What to run CS3 on" question

    I'm an R&D Engineer and started a couple years ago doing video work for the company I work for and am in need of a laptop to work on as a mobile work station. I travel a lot and need to keep up with things rather than come home to a huge project while I have other work backing up while I am gone.
    I've researched many lap tops, Alienware looked great till you start searching for reviews. Looked at Macbook pro but I guess I am rebelling against Mac for no apparent reason (like pc's, call me weird). Dell...well they own Alienware and have seen some similar reviews and not sure the config is what I'm looking for, so here is what I am down to.
    HP HDX
    Vista Home Premium (32-Bit) Yes I know some have had issues with Vista for some crazy reason I'm willing to give it a go.
    Core 2 Duo T9300 2.5GHz
    3GB Memory
    512 Nvidia GeForce 8800m Video card
    2 internal 120GB Sata Drives @ 7200 rpm (Called HP and they said the two drives are not striped in a raid configuration)
    Will also run a eSata external in Raid 0 Gig unknown at this time.
    I pretty much use PP CS3 and PhotoShop CS3 for most of my work But I am a AE junkie, a cold beer and a nice long session with After Effects CS3 is what I call a hot Satarday night nowadays. I am working with a GL2 at the moment but will be moving to HD sometime this year. What I would like to do here is be able to function, without massive head aches and get my work done and enjoy my downtime stuck in hotel rooms working in AE.
    Its okay if render time is longer than on my custom desktop, gotta get out and eat sometimes. So the big question is in your experience is it possible to run CS3 Production Premium Suite on this system and have a ball with it or is there a better machine for a mobile work station out there?
    Right now the imaginary buget is at 3,000 but I'd go a bit more for piece of mind if needed and I'm not concerned with size or weight, its not for working on an airplane or at Starbucks.
    Thanks in advance for your opinion and don't be uncomfortable about being brutal, good or bad I want to hear it.
    Woody

    I don't see any problems other than...
    - you won't be able try different display cards.
    (no dual screens and no incompatibility workarounds.)
    - you won't be able to try any high end HD-SDI capture cards.
    (you may need one for full HD ingest.)
    - how are you going to capture your video onto the laptop?
    (you'll need a firewire pci card to capture HDV, you won't be able to capture full HD without a high end HD-SDI card.)
    - i would get the fastest cpu you can afford.
    - i would get the largest screen you can get on a laptop.
    - make sure the laptop has video outputs.

  • Adobe Flash CS3 Rollover Question

    This should be a relatively simple question. I am using Adobe
    Flash CS3. I created an image in photoshop with layers and imported
    it in to flash. Basically the image I have is a map with a bunch of
    different states and my goal if when a user rolls over a state I
    want to state to display a color. As many of you know states are
    not in perfect rectangles, so when I do this click on a layer,
    convert to a symbol, then change the rollover state to the way I
    want it, the active rollover "hotspot" overlaps with other states
    because the layer outline overlaps with the other layers. Therefore
    I can not produce the ability to click or rollover neighboring
    states. Basically I need to use some type of hotspot function or
    tool to get rid of the default rectangle that revolves around the
    state.
    Please give me specific directions on how to change the layer
    shape to conform more with the actual layer rather than a rectangle
    surrounding the layer.
    Please let me know if you have any questions,
    Neil

    Bookmark and download Flash from here, DO NOT trust any website telling you to install anything or follow their links.
    Flash update
    http://get.adobe.com/flashplayer/
    Silverlight update
    http://www.microsoft.com/silverlight/get-started/install/default.aspx
    There is a FlashBack trojan making the rounds which tries to con people into installing it by looking like it's the real thing.
    Make sure your Flash (and Silverlight) is current by running these checks
    http://flashbuilder.eu/flash-player-version.html
    https://www.mozilla.org/en-US/plugincheck/
    You Mac likely will come across sites and content that won't play in Quicktime or in your web browser unless you install additonal codecs
    You can get them here
    Perian
    http://perian.org/
    VLC
    http://www.videolan.org/vlc/download-macosx.html
    Flip4Mac $29
    http://www.telestream.net/flip4mac-wmv/overview.htm
    How to install
    When you click a link, a download of the installer file occurs to your Downloads Folder usually located next to your Trash Can or in your Users Folder.
    Open the folder and double click (or File: Open) the download and icon can appear on your desktop which you open and inside is a installer package which you double click on to launch the installer.
    OS X will check the download to make sure you intended to start it and that it's not malware it knows about.
    Follow the installer instructions to install the software onto your computer and quit when finished.
    Some require the browsers to be closed first, others require the machine to be restarted to enable the software.
    Once the install is completed, remove any and all downloads from your Download folder, it's safer to keep this folder empty so you can keep track of what appears in there.
    Drive by downloads of malware can occur and reside in the Downloads folder, mixing in with files residing there and await your click to install.

  • "AFX CS3 - RAM Question"

    hi,
    i have a question about the usage of RAM in After Effects CS3.
    If i start AFX it says "using 5% of 3GB" - but i got 5GB...the same number appears while i'm previewing my comp.
    System: 5GB RAM - 2x Dual Core 2,6 Ghz MAC / Tiger
    Thx.

    See the
    "Render multiple frames simultaneously" section of After Effects CS3 Help on the Web for the "how".
    See the other sections in
    "Memory, storage, and performance" for the gory details of how After Effects uses RAM and such.

  • Belated CS3 Layer Question

    Hello,
    I apologize for asking a question about CS3, but that's what I happen to be using at the moment. How do I unlock the initial background layer or create new layers when editing, say, a .png? In previous versions, that layer could be unlocked just by double-clicking and setting the layer to Layer 1, and creating new layers would automatically change the image to a .psd while it was being worked on.
    I can't believe that I'd actually have to make a new image and copy/paste everything to it; I must just be missing the way to unlock the layer or have my settings set incorrectly.
    Thank you for your time

    goldsunstar wrote:
    I apologize for asking a question about CS3, but that's what I happen to be using at the moment. How do I unlock the initial background layer or create new layers when editing, say, a .png? In previous versions, that layer could be unlocked just by double-clicking and setting the layer to Layer 1, and creating new layers would automatically change the image to a .psd while it was being worked on.
    I can't believe that I'd actually have to make a new image and copy/paste everything to it; I must just be missing the way to unlock the layer or have my settings set incorrectly.
    You still double-click on the layer in the Layers Palette. You can also right-click or bypass the renaming step with Alt-click.

  • Startup with Premiere Pro CS3 - few questions

    Hi,
    I am totally newbie to video editing (and to ADOBE CS programs).
    To introduce, here's my setup.
    New camcorder (Canon VIXIA HV30, HDV format, miniDV) - still in the owner manual for very basic things...
    Premiere Pro CS3 (soon CS4 as entitled to upgrade)
    Vista x64 Home Premium
    Core 2 Duo 1.86 Ghz, 4GB RAM
    Firewire card
    I just started to fool around with CS3 and with this camcorder, doing some tests (I use the mini DV HD tapes).
    When I capture to Premiere, here are some of the annoying things happening :
    1) instead of viewing in real time what is happening, I get a multilingual screen saying that tape is being captured... (very very useful !!...)
    2) when I playback the scene, I see edges of things kind of blinking white - just the edges - some sort of what I would call 'distortion' but maybe it's not the right term... Is this just a matter of not having a high-end video card and then, I should not worry: the editing I would do would not appear on a DVD or a published video ? Or, am I doing something wrong ? (last but not least: does it have to do with the camera ? - although I do not see this when watching on the camera side viewer.)
    3) This camera can shoot 30p, 24p, hi-def (but HDV format - not AVCHD): what should be the setup to choose :
    - on the camera ?
    - when I launch Premiere and am prompted with a window to choose format?
    Let's start with these basic questions...
    Thanks in advance,
    Rob

    Rob,
    1.) You *may* have problems with CS3 and 64-bit OS. CS4 is optimized to work with (though it is still a 32-bit app) 64-bit OS. Things *should* be better. CS3 works beautifully with 64-bit OS for some. Others are not so lucky.
    2.) With the Capture of HDV, you will not get real-time Capture preview - nature of the beast.
    3.) Can you post a tiny amount of this footage, or a still cap to show what it looks like?
    Good luck,
    Hunt

  • Photoshop CS3 to Dreamweaver CS3 CSS question

    Hi all,
    I am sorry if this is allready dicussed a couple of times.I did a search and just could not find it. When I export a site from Photoshop CS3 to DIV (generate CSS by ID) it is aligned to the left and all DIV's have a specific position on the page. How can I get my site to center in Dreamweaver CS3 without having to adjust al separate DIV's?
    For Example: When I export from Photoshop all slices are exported as folowed.
    #Table_01 {
    position:absolute;
    left:auto;
    top:0px;
    width:832px;
    height:562px;
    right: auto;
    #test-13 {
    position:absolute;
    left:275px;
    top:26px;
    width:9px;
    height:189px;
    #test-14 {
    position:absolute;
    left:284px;
    top:26px;
    width:128px;
    height:98px;
    I know how to make a DIV center (with Margin auto left and right) but I do not know how to center all DIV's at once.
    I hope you are willing to help me with this. In case you have more questions let me know.

    The answer is to not let Photoshop write either your HTML or your CSS for you.  What you show is a disaster waiting to happen, really, and is characteristic of the kind of mess produced by any wizard that writes HTML based on a graphic layout.  Use your graphics editors to produce your graphics.  Build your page in DW.  It's a much better way to go.
    I know how to make a DIV center (with Margin auto left and right) but I do not know how to center all DIV's at once.
    I hope you are willing to help me with this. In case you have more questions let me know.
    Leaving your page with all absolutely positioned elements is really asking for trouble, but here's how to make them all center at once -
    Change this -
    </head>
    to this -
    <style type="text/css">
    #wrapper { width:760px; margin:0 auto;position:relative; }
    /* 760px will display on an 800px screen maximized browser window without */
    /* horizontal scrollbars. Change as needed */
    </style>
    </head>
    change this -
    <body ...>
    (the ellipsis represents any other attributes that might be mentioned in the body tag, and SHOULD NOT BE INCLUDED EXPLICITLY!)
    to this -
    <body ...>
    <div id="wrapper">
    and this -
    </body>
    to this -
      <!-- /wrapper -->
    </div>
    </body>
    and see if that helps.

  • GREP question re: character style

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

    What I'm really looking for is this. When I want to format a paragraph in a paragraph style, sometimes there are underlying character styles that I need to clear first. So I higlight the block of text, go to character styles and select [None], thus clearing that text of any character styles. Then I apply my paragraph style. I've found that if I don't do this, I get unexpected results.
    I know that the active characer styles is always the last character style that was used, but I wish that the default was simply the [None] character style. I'm forever having to go back to [None.]
    I'm trying to build some scripts that automate this for me, but perhaps there's a much easier way to think about this problem.
    Message was edited by: JoJo Jenkins

  • A grep question

    Hi all,
    Sorry, I know its a Java forum but all of you know Unix shell much more than me and might be able to help me. I came across following in a Unix shell programming tutorial:
    * Execute statements as long as a condition is false
    until grep "sort" dbase_log > /dev/null
    do
    sleep 10
    done
    echo "Database has been sorted"
    * Example executes until grep is unsuccessful
    Doesn't grep looks for word "sort" in the dbase_log file? It does not actually execute "sort" as sort command, right? Why it says that "Database has been sorted"?
    Any help is greatly appreciated.

    Not sure if that's sarcasm or what, but I figured
    you'd already gotten your answer, so there was no
    harm in a little wisecracking.Not sure, what do you mean, I got to forum after a
    while and saw the replies. Yes, I figured out my
    answer, just thanked you, b/c that was the best
    answer that could be to the first posting which
    compared my question to 'sex' question and I found it
    non-sence.Okay, I'm confused. I'm not sure what you're saying here.
    If you're thanking me for giving you the real answer, your aim is off. :-) Somebody else posted the real answer.
    If you're thanking me for being a wiseass, you're welcome, but I'm just doing what becomes naturally.
    I thought maybe you were being sarcastic because you didn't like my wiseass comment.
    Anyway, I'll let it drop now, before I confuse myself any more.

  • Rookie CS3 Button Question,

    Hello all,
    I'm fairly new to encore and got a project dropped in my lap today a work. I'm sure this is simple ,but I don't know exactly what to search for. so here we go:
    I have a complete .PSD file that the client wants to use as a menu. The buttons have three versions: 1. Original state, as you would see it on the screen.  2. Highlighted, what you would see if you move the cursor over the button and 3. Selected, the button will highlight when you push play/enter.
    My question is how do I set these layers in the menu to react with the cursor properly?
    I only have two buttons on the menu (play and Scene select) and three versions of each button (mentioned above) built in as layers in the PSD. and i have no idea how to set the links/hierarchy.
    any help/guidance/tut links would be appreciated. they seemed to have misplaced the manuals, so I've gotta rule that out for now.....

    The beauty to using Stanley's suggestion of starting with one of the Templates, is that the Button Layer Sets and the necessary naming conventions will be there for you, already. Saves a lot of mistakes and extra work.
    Make special note of the Button Layer and Layer Sets' naming. Those initial characters are VERY important, as the take a regular, Layered PSD and turn it into a functioning Menu in Encore.
    I will Rename those Layers & Layer Sets, AFTER the space (leaving those necessary characters in place), to match up with my Timelines, or other Assets. Then, rather than trying to remember that "Button 1" one Scene Selection Menu 3 links to "Liz's Birthday," I will see the name, "Liz's Birthday."
    I also name my Timelines, usually from" 01 Intro," to "0x Whatever," so I can easily see the order, and then use those names (after the space). I find that a little extra work initially, saves me a lot of extra work and confusion, later on.
    Good luck,
    Hunt
    PS - I also highly recommend Jeff Bellune's book, The Focal Easy Guide to Adobe EncoreDVD 2.0, Focal Press. Though written for EncoreDVD 2.0, 100% of the book translates directly to CS3 & CS4.

  • Premiere Pro CS3 Capture Question (Firewire to USB Converter)

    Does Premiere Pro CS3 support capture through a Firewire to USB Converter?  More specifically, we have one particular PC laptop that does not have a firewire port, only USB 2.0.  So we were thinking of getting a firewire to USB converter.  Will that work for capturing footage from our Mini DV camera?
    Camera is Canon XH-A1S HD and a firewire cable will be running from this camera to the firewire to USB converter, then a USB cable will be running out of the converter into the dual core laptop with Windows 7, 4GB RAM, Nvidia 460M video card.
    Thank you!

    Might work then again it might not. Have not heared of any positive results. In other words imo its a waste of money.
    You need a real firewire connection.

  • [CS3] GREP-Problem with Anchored Objects

    Hi,
    I've the following problem:
    Lines beginning with a, b, c etc. should be formatted equally, so I use the following GREP:
    Search:
    ^([a-z])(\.??)([ \t])
    Replace:
    $1.\t
    Now there are some abc lines, which begin with an anchored object, so I tried:
    Search:
    ^(~a*?[a-z])(\.??)([ \t])
    Replace:
    $1.\t
    But with this, the anchored object is deleted. Is this a bug or am I doing something wrong?
    Thanks
    Tobias

    That's a known bug -- Dave Saunders discovered it, to his surprise, I might add. There seems to be no reason for it.

  • [JS CS3] Grep difficulty

    Hi,
    I succeeded creating a grep pattern which is used for a string replacement.
    var myRegExp = new RegExp ("\..-.*.indd")
    if the string is like this, it runs very well :
    var x = "001296.01.A-ATELIER GLOTIN.indd";
    but like this, it's not satisfying :
    var x = "001296.01.ABC-ATELIER GLOTIN.indd";
    I cant't get a grep search for a dot, any character n times, a dash, any character n times, a dot, and indd string.
    if I do this, var myRegExp = new RegExp ("\..*-.*.indd"), it removes almost everything in the string
    What I do wrong ? I am seraching on all grep sites but can't find any clue.
    Thanks for light, Loic

    Hi Peter,
    Thanks for help,
    It runs as you may expect it ;-)
    For a developpement profane such as me, Grep appears as powerful than mysterious.

  • CS2- CS3 Observer questions.

    Hello.
    Im porting a plugin from CS2 to CS3 on MAC and have run into a problem with the observer structure.
    In the CS2 plugin we simply used the default values available, IID_IUNKOWN & IID_IOBSERVER...
    i IsAttached (IObserver *observer, const PMIID &interestedIn=IID_IUNKNOWN, const PMIID &asObserver=IID_IOBSERVER)=0
    Called simply like this... mySubject->AttachObserver(this);
    As of CS3 however this no longer possible for the "intrestedin" parameter to be left undeffined, instead the specific IID you want to monitor is required. If I understand things correctly.
    i AttachObserver (IObserver *observer, const PMIID &interestedIn, const PMIID &asObserver=IID_IOBSERVER)=0
    Where can I find information on what IID is connected to what action? My main interest is in guide movements and switching documents both of which my plugin have to react to.
    What IID should be used to notify the plugin of movement of a guide?
    What IID should be used to notify the plugin of switching of the current document?
    Is there any documentation anywhere on what IIDs should be used to monitor what actions?
    Grateful for any help.
    Carl Johan Rydberg.

    Thanks Dirk, the observer finally observed.<br /><br />But how can I make sure it is a guide that is being moved? In the old code theChange was sent by kMoveGuideAbsoluteCmdBoss so it was available immediately. Also since it was the IID_IDYNAMICUPDATE that was the protocol used it was possible to check what state it was in before executing our function.<br /><br />if (theChange == kMoveGuideAbsoluteCmdBoss )<br />   ICommand* cmd = (ICommand*)changedBy;<br />   InterfacePtr<IDynamicUpdate> update(cmd, IID_IDYNAMICUPDATE);<br />   IDynamicUpdate::DynamicState state = update->GetDynamicState();<br />   if (state == IDynamicUpdate::kEndDynamic)<br />   {<br />      mystuff->UserMovedGuides(kTrue);<br />   }<br />}<br /><br />Where do I find the kMoveGuideAbsoluteCmdBoss you mentioned and how do I access it to check if it was a guide movement that was signaled?<br /><br />Carl Johan Rydberg

Maybe you are looking for

  • Transform question

    In Java, I use javax.xml.transform to transform xsl/xml. Here is part of the xsl:     <node>         <xsl:apply-templates select="node"/>     </node>If there do not have node in the xml, then the output will be <node/> . But here, I wanna to display

  • TS1559 My ipod wifi slider button is in grey mode and I cant slide it across from off to on, any suggestions?

    My ipod wifi slider button is in grey mode and I cant slide it across from off to on, any suggestions?

  • Need suggetions on Central SLD as Solution Manager!

    Hi Experts, I need a help/ suggestion on deciding the Central SLD system in our landscape. We are using Solution Manager 7.01 as the Central SLD for the new Installations and including the old Systems too. But We came to know that SAP is not recommen

  • Massive problems installing itunes and quicktime

    Hi, to anyone who can help me: I cannot install iTunes or quicktime. Just bought a new ipod 30gb. v.excited. Downloaded itunes. gives me error messages when i try to install. They read: "Windows cannot access the specified device, path or file. You m

  • 2 problems one question

    I opened iPhoto today. Some, not all,(about 20%) my photos were "tall and skinny". Any help? AND............When I tried to edit them in iPhoto, when I clicked on thumbnail across the top, it would open a totally unrelated photo???????????? Help plea