Help Me Write A GREP Expression?

I have a list of numbers formatted like:
(801234123412)
that should read:
80-1234-1234-12
I know it can be done, I just don't know how, and am short on time for learning.

Try this:
Find \((\d\d)(\d\d\d\d)(\d\d\d\d)(\d\d)\)
Replace with $1$2$3$4
Bob

Similar Messages

  • Help building a grep expression

    hello,
    pls can someone help me build a grep expression for a dictionary:
    abcdef
    hjtoku
    yghmns
    I need an expression that would find in each word where the underline starts, and put, lets say, an asterisk there:
    abc*def
    hjto*ku
    ygh*mns
    thank you in advance!

    Underlines are a character attribute, not a glyph, so there's not a lot of complexity to this. To find underlined characters search for .+ and in the find format section set the basic character attributes to underlined. Understand that this will find underlined characters anywhere, even at the start of the word. If you don't want that it's a lot more complicated and I haven't figured it out myself, yet.
    To add the asterisk change to *$0
    This will add the asterisk, but it will also be underlined, so you need to run a second search for \* (you need to escape the asterisk character in the search field to find a literal *) with the underline attribute and change to nothing, but change the attribute in the change format to no underline, or if you wanted to remove the other underlines as well it could be done in the first step by removing the underline attribute in the change formatting.
    Peter Kahrel has a nifty script for chaining find/change queries to run in one step.

  • Need some help with GREP expressions

    I know--KNOW--there's a way to do this, but my GREP expressions keep failing.
    I want to add an em dash before any phrase that's in a paragraph style. So I obviously want the em dash to be in the location "beginning of paragraph." All my GREP searches keep failing. Can someone help?

    Adobe's implementation of "beginning of paragraph" is a tiny bit off from standard GREP (which, in itself, is less a set of hard & fast rules, but more like "guidelines"). Yes -- you can search for beginning of paragraph using plain ^, but you cannot use it with a replace operation.
    The trick is to give InDesign something to look for. Search for
    ^.
    (that's right -- one wildcard right after the start of a paragraph). You don't want to loose the character it finds, so replace with
    ~_$0
    where the first 2 codes is your em dash and the last 2 are "the entire found text". That's your original wildcard-found character!
    Don't forget to put your paragraph style in the Find Formatting box.
    This workaround works around the implementation failure, because you indeed want to add something to existing text. Unfortunately, another fairly standard GREP to look for empty paragraphs -- ^$ -- doesn't work, because then you have no place for a wildcard character ... (and yes, you can use a hard return \r instead of either first or last code, but then it won't work at beginning or end of story). It's one of those things I hope to see corrected with CS5.
    [Edit] Ha! Peter beat me to it but he made a typo. Besides, my story is longer.

  • Bug within Write to Measurement Express vi

    I think I have found a Bug within the Write to Measurement express VI.   I have attached an example VI to help reproduce the error.
    Here is a bit of history.. I have a data monitoring system which runs continuously.  I have the write to measurement setup to create a new file every 12 hours.  What I noticed is that even though a new file has been created,  I still cannot access the old files until I stop the VI that has the Write to Measurement VI in it.  I am trying to access the files via Diadem.  
    For this application, it is not practical to stop the Data Monitoring Main VI every time I need to look at the data.  The alternative that I found was to not use the Write to measurement express VI and use open/write/close TDMS vi's.   This is not an acceptable solution as the features programmed into the Write to measurement Express VI are need for my application.  
    Can someone please fix this or help me fix it?
    Thank you
    Mike
    Attachments:
    example code.vi ‏77 KB

    Hello Mic,
    Please understand that I can suggest a workaround, and I've tested it in your scenario and it seems to work OK, but I cannot guarantee this workaround for all possible use cases of this Express VI.  It is for this reason that we generally don't like to recommend one-off modifications to VIs that ship with LabVIEW - they do not get tested with as wide a set of use cases as we do on VIs when we ship them.  As such, I'm not going to just hand you a VI to replace in vi.lib, but I will show you a few edits you can make to work around this issue.
    Open this VI:  "[LabVIEW Install Dir]\vi.lib\express\express shared\ex_TDMS\ex_createorOpenTDMS.vi"
    Open its diagram.  Near the left there's a section that looks like this:
    The current known bug is with the "Not A Number/Path/Refnum?" function on TDMS files, so you'll see the following changes in the below diagram, which hopefully you can make and try out in your use case.  I would highly recommend making a backup copy of this VI before saving any changes!
    Delete the "Not A Number/Path/Refnum?" function.
    Connect the "new file?" input to a "Not" function, and wire the output of the "Not" to the case structure selector where "Not A Number/Path/Refnum?" was previously being used.
    Delete the wire connecting the error out of the first inner case structure to the second inner case structure, and re-route the error wire around the first case structure.
    Hopefully with these three instructions and comparing the shipping and workaround images you can successfully get up and running.
    Message Edited by Jeff B on 03-01-2007 08:12 AM
    Attachments:
    shipping.gif ‏5 KB
    workaround.gif ‏6 KB

  • How to write the map expression for a const string

    hi all,
    i am trying to map from source table A to target table B. Table B has a column that A doesn't have and the column type is string.
    what should i do if i want to keep this column a const string like "abc"? How to write the map expression?
    Setting a default value like "abc" of this column in database is not available .
    please try to help, thanks a lot.
    jun

    Hi jun,
    You mean, u want to give some hard coded value to a specific column in mapping?
    If so , give 'abc' in the target column and execute it on Target.
    Thanks,
    Guru

  • How to write the regular expression for Square brackets?

    Hi,
    I want regular expression for the [] ‘Square brackets’.
    I have tried to insert in the below code but the expression not validate the [] square brackets.
    If anyone knows please help me how to write the regular expression for ‘[]’ Square brackets.
    private static final Pattern DESC_PATTERN = Pattern.compile("({1}[a-zA-Z])" +"([a-zA-Z0-9\\s.,_():}{/&#-]+)$");Thanks
    Raghav

    Since square brackets are meta characters in regex they need to be escaped when they need to be used as regular characters so prefix them with \\ (the escape character).

  • GREP Expression for Varying Text

    I have an index in which I'd like to Find/Change all the entries with a character style, but stop the GREP expression before the tab, leader, page numb. They vary though. Here are 3 indexed examples:
    A16T-PVUNL-3
    A-100-90-3CT-300
    B-20-22-50-3/4 shank
    Is there any way to constrict this to just the characters and digits, then stopping before the tab? I achieved it in another index whose entries are 7-digits only with this expression: ^(\d+)
    The return constricted it so that search did not find the page numbers after the tabs.
    Thanks.

    http://help.adobe.com/en_US/indesign/cs/using/WSE33E49F9-94CE-4043-AA51-4761408A63F4a.html #WS6F1E524C-8F74-4331-A813-33D08F983E94 is the official help page.
    You'll find a bunch of other resources listed here: http://community.adobe.com/help/search.html?searchterm=Nested+Styles&q=Nested+Styles&lbl=i ndesign_product_adobelr&x=0&y=0&area=0&lr=en_US&hl=en_US

  • GREP Expression Needed

    I'm reposting this here, hoping some genius scripters will know more than the designers ---
    I've scoured the websites and have been trying to figure out the correct GREP expression for what I'm trying to achieve, but to no avail, so alas I am posting this in hopes of ending my misery.
    I want to add an italic character style to the names of Naval ships (USS xxx xxx) in my book.  I want to italicize the name, but not the 'USS'. Any ideas?
    Thanks a million.
    ~Laurie

    Here you go (needed a break). Write the names in a text file, one name per line, and save it in the scripts folder using the name uss_names.txt. The first line in that file must be the name of the character style you want to use. If that style doesn't exist, the script creates it.
    Peter
    if (app.documents.length == 0) exit ();
    // Read the text file
    ship_names = get_list ();
    // Create character style if necessary
    if (app.documents[0].characterStyles.item (ship_names[0]) == null)
        app.documents[0].characterStyles.add ({name: ship_names[0]});
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.changeGrepPreferences.appliedCharacterStyle = app.documents[0].characterStyles.item (ship_names[0]);
    for (i = 1; i < ship_names.length; i++)
        app.findGrepPreferences.findWhat = "(?<=USS\\s)" + ship_names[i];
        app.documents[0].changeGrep ()
    function get_list ()
        var f = File (app.scriptPreferences.scriptsFolder + "/uss_names.txt");
        if (f.exists)
            f.open ("r");
            var temp = f.read ()
            f.close ();
            return temp.split (/[\n\r]/);
        else
            alert ("Can't find uss_names.txt.");
            exit ();

  • Can anyone help me write a script that would click "get info" and then "enter" on each movie in my itunes library? I am asking because my itunes 11 repeatedly loses the artwork to my movies in my itunes library.

    Can anyone help me write a script that would click "get info" and then "enter" on each movie in my itunes library? I am asking because my itunes 11 repeatedly loses the artwork to my movies in my itunes library. I can restore the artwork (and make my apple tv see the movie exists as well) by going into the movie library and clicking on each movie by hand, slecting get info, and then selecting enter. Now doing this 10 times in 20 days was fun and all BUT I would really like to automate the process so everytime itunes screws it up I can fix it easier.
    I saw this example of an itunes script that restores artwork for music
    tell application "iTunes" set theSelection to selection repeat with i from 1 to count of theSelection tell (item i of theSelection) set artworkCount to count of artwork repeat artworkCount times set theArtwork to data of artwork 1 delete artwork 1 set data of artwork artworkCount to theArtwork end repeat end tell end repeat end tell
    but I need to tweak this to fit my needs for simply clicking the "get info" button and "enter" in the movie library rather than all the stuff this guy has listed. Any ideas or help on writing this? Thanks.

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • How to close a write to file express VI

    Hi, 
    I am using an Write to File express VI inside a subVI in LabVIEW 7.1.  Since it is in a DAQ loop it is configured to create only one file even though it is called many times. 
    The problem I am having is that when the subVI itself is closed and reopened the express VI does not prompt to create a new file.  Is there a way to get around this? 
    I am hoping there is some sort of invoke or property node that I can use on either the express VI or the subVI itself to close or "reset" it.
    Does a subVI stay in memory even after the front panel is closed?  I am guessing this is what is causing my problem.  Any ideas?
    I do realize the BEST thing to do here would be to simply not use an express VI but I am hoping there is a way to fix this without going that far yet.  From what I can tell LV7.1 does not allow me to convert an express VI to code which makes it look like it will take even longer to rewrite this.
    For now the solution we have in place is the following:  close the subVI, close the main program (the calling VI), and then reload.  
    Thanks,
    Dave

    dave,
    if i remeber correcty... there is a file path option will be available with the express vi... I actualy can not reproduce this here since i dont have LV 7.1. So if you feel that the express vi does not gives you a prompt for selecting the file path, then just place a "File dialog" function before the express vi and wire the selected path.
    Regards
    Guru (CLA)

  • Need a help to write the query

    Hi,
    I need a small help to write the query.
    I have a table contains couponid,coupon,createdate,expirationdate,assigndate from couponday table
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.
    Thanks in advance

    Hi,
    user586 wrote:
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
    SELECT  coupon          -- or whatever columns you want
    FROM    table_x
    WHERE   expirationdate  NOT BETWEEN  SYSDATE - 30
                                AND      SYSDATE + 30
    ;

  • Hi , i need help for resetting my airport express as a repeater since this one is already register to old wifi. thanks

    hi everyone. i need help for resettting my airport express as a repeater. i bought is airport express 2nd hand. so now this one already registered to old wireless.
    could anyone have any advice. thank you.
    now the airport express is blinking yellow color.
    my main base is using time capsule. this is a new one so when i first turn it on and set it up in airport utility its very easy.
    now setting the repeater (airport express) is ............ ???
    thanks everyone.

    Do a factory reset, then it'd be like it's new from the Apple Store.
    http://support.apple.com/kb/ht3728

  • Help me in Installing Solaris Express, Developer Edition  X 86

    Hi,
    Help me in installing Solaris Express, Developer Edition
    When i am trying to install Solaris, system hangs and the moniter is switcher off when the system goes in GUI mode.
    i have intel 945GTP mother board with as on board Intel Graphics Media Accelerator Drives , Chipset -> Intle 945G , 160 SATA Hard Disk, 1 GB DDR2 Ram , P4 3.Ghz Processer , on board Intel PRO/100 VE Network Card.
    Please,Help me.
    Thanking you,
    P.Sathish Kumar

    Hello,
    first of all: Try to run the HCTS (Hardware
    Compatibility Test Suite) first, it's available
    here:
    http://www.sun.com/bigadmin/hcl/hcts/device_detect.htm
    l
    This you can run from Windows, and it will list all
    hardware that has drivers, and all those, that do not
    have drivers (including some public domain drivers).
    After that, you have the possibility to install
    Solaris WITHOUT a GUI, use one of the two "terminal"
    modes. The first Is still a GUI, as it only starts X
    and opens a terminal, in which then the installer
    runs. The second does NOT start X, but runs the
    installer on the console. Try this one, and once you
    get through that, you can afterwards figure out the
    settings of the Xserver.Hi ,
    i have installed the solaris using console.
    Still GUI is not starting, the moniter is switched off when GUI gets started
    I used Hardware Compatibility Test Suite, its say that system is supported
    by Solaris.
    Should i have change BIOS setting to stated the system
    Bye
    P.Sathish Kumar

  • Help me in installing Solaris Express, Developer Edition X86

    Hi,
    Help me in installing Solaris Express, Developer Edition
    When i am trying to install Solaris, system hangs and the moniter is switcher off when the system goes in GUI mode.
    i have intel 945GTP mother board with as on board Intel Graphics Media Accelerator Drives , Chipset -> Intle 945G , 160 SATA Hard Disk, 1 GB DDR2 Ram , P4 3.Ghz Processer , on board Intel PRO/100 VE Network Card.
    Please,Help me.
    Thanking you,
    P.Sathish Kumar

    Hello,
    first of all: Try to run the HCTS (Hardware
    Compatibility Test Suite) first, it's available
    here:
    http://www.sun.com/bigadmin/hcl/hcts/device_detect.htm
    l
    This you can run from Windows, and it will list all
    hardware that has drivers, and all those, that do not
    have drivers (including some public domain drivers).
    After that, you have the possibility to install
    Solaris WITHOUT a GUI, use one of the two "terminal"
    modes. The first Is still a GUI, as it only starts X
    and opens a terminal, in which then the installer
    runs. The second does NOT start X, but runs the
    installer on the console. Try this one, and once you
    get through that, you can afterwards figure out the
    settings of the Xserver.Hi ,
    i have installed the solaris using console.
    Still GUI is not starting, the moniter is switched off when GUI gets started
    I used Hardware Compatibility Test Suite, its say that system is supported
    by Solaris.
    Should i have change BIOS setting to stated the system
    Bye
    P.Sathish Kumar

  • Help with Java and Regular Expression

    Hello,
    I have one line of Java and regular expression that I got from the web :
    String[] opt;
    opt = line.split("\\s+(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
    If "line" contains :
    1 "Hello World"
    this code would give me :
    opt[0] : 1
    opt[1] : "Hello World"
    which is almost what I would like to do except for the double quotes. I wonder if someone could please help me change the regular expression so that it would return :
    opt[0] : 1
    opt[1] : Hello World
    Thank you and Best Regards,
    Chris

    It looks to me like this is a line from a space delimited file so you should use one of the free CSV parsers such as http://opencsv.sourceforge.net/ . These will handle the quotes properly even if a field actually contains a quote.

Maybe you are looking for

  • How Can I play iTunes on my HDTV without Apple TV?

    I am looking for an affordable method of playing iTunes on my big screen HDTV. In other words, I just want to mirror whatever is on my iMac screen on my HDTV. So I want ALL the iTunes features like the visualizer, randomizer, etc. to work without a h

  • How to use multiple ejb-jar.xml files

    Hello - If the project you work on has a lot of beans that you need to configure them in one ejb-jar.xml file. Then ejb-jar.xml file will be getting bigger and bigger. I am wondering if there is any way to divide the ejb-jar.xml file into multiple su

  • Re: Handling an exception in a superclass...

    Akos, When subclasses override ExecSQL(), do they call super.ExecSQL() before/after doing additional processing? If so, it makes sense to handle some generic exceptions in the superclass. If not, then your exception handlers will never be executed. F

  • Black screen, no response?

    I was running Tiger 10.4.10. I booted the computer, and it would not go past the white apple spinning gear screen. I took it to my mac store. They did not have my Tiger disks, and chose to install Leopard for me. If I do not touch it within 5 minutes

  • Viewing Quicktime Movie?

    Hello, I'm working as a transcriber on a show that just switched its format to HD. They've given me the files on an external hd with firewire, and I'm supposed to type out the dialogue using InqScribe, which is basically Quicktime with a little notep