Regular expression to remove a part of the URL

I need do the following:

"" Search for all URLS that contain" http://www.mycompany.com/dept/catalogs/ ' and remove whatever happened... / catalogs / '.

Basically I have 3000 + links that start with " http://www.mycompany.com/dept/catalogs/" and I need to strip it of everything what they have after the part of the URL .../catalogs/.

Anyone know of an automatic way to achieve this?

Thanks in advance!

In what programming environment you doing this?

In find/replace DW?

If so, then try this carefully on a test page, because I have not tested:

To find:

http:///\/www\.mycompany\.com\/dept\/catalogs\/[^\"]*\".

Replace with:

http://www.mycompany.com/Dept/catalogs/ ".

If you need it in another environment, let us know.

--

E. Michael Brandt

www.divaHTML.com
www.divahtml.com/Products/scripts_dreamweaver_extensions.php
According to the standard scripts and the Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, and alia

--

Tags: Dreamweaver

Similar Questions

  • regular expression to remove the zeros on the right

    I need a regular expression to remove the zeros after the decimal point. I tried (?.)<=\.\d+?)0+(?=\D|$) but="" i="" get="" a="" error="" about="" look="" behind="" not="" a="" fixed="" length="" or="" something="" like="" that.="" i="" am="" not="" a="" regex="" expert="" and="" i="" was="" wondering="" just="" how="" to="" do="" this="" with="" regular="" expression="" or="" some="" other="">

    Z.K. wrote:

    [...] or some other way.

    I tried and I tried but I couldn't crack with a regular expression, so I took the easy way.  The first match found pattern the comma and the other removes the zeros to the right of the rest.  It is not discriminate between numbers and all the rest, though.

  • Regular expression to remove a single carriage return character

    Hi all

    What is the regular expression to remove only one character to return to a text string. I have something like this:

    1

    (two returns)

    2

    and I want to delete only one of the characters turn it over so I'll go

    1
    2 (one after the other

    I know / r but ot deletes all of the text string.

    Thanks a lot for any help

    Try something like:
    (in my message window):
    s = "a" & RETURN & RETURN & "two".
    placed s
    l = [s]
    put re_replace (l, "(?)")<=\r)\r", "g",="">
    Place the [1]
    (exit):
    -"a".

    two ".
    -1
    -"a".
    two ".

    I don't know how effective the situation described above could be for research, but
    You can also try:
    put re_replace (l, "\r\r", "g", RETURN)
    or:
    put re_replace (l, "\r{2"}, "g", RETURN)
    However, these last 2 only work in the situation where there
    exactly 2 returns you want to replace with a single DECLARATION - the first
    replaces any number of multiple returns with one RETURN

    It is possibly more effective than the first - it will replace again
    all multiple with a single; but it will unnecessarily replace one
    RETURN character with one character in RETURN - but I'm not a regular expression
    Expert:
    put re_replace (l, "\r+", "g", RETURN)

  • How to dynamically change the last part of the url inside the body HTML in e-mail send to Apex process

    Hello

    I need to change the last part of the URL sent by post in the apex dynamically. I have a requirement that a person can register itself with a new user name and other details. When the user clicks on the button register after you have entered all the required values in the page all values will be inserted into the user_details_repository table in the database. At the same time an email with a url link is sent to the user admin for the assertion. When the admin user, click on the link it is redirected to a page where all the details submitted by this particular user is displayed. The admin user can confirm or reject the new user registration. If the admin user says, all the data repository of this particular user table will be inserted in a main table named user_details and data will be deleted from the repository table. Yet once if the admin user rejects, all the data repository of this particular user table will be deleted.

    For this, I have created two pages for this and all of the features mentioned above works correctly except change the link url each time a letter is sent to the admin user when a new user register itself. To send email, I created send e-mail process. I need to change the last word/part of URLs within html body according to the username provided by the new user.

    for example, the url to another user will be like this:

    http://localhost: 8080/apex/f? p = 103:9:3849261906471:NO:USERNAME:Namrata

    http://localhost: 8080/apex/f? p = 103:9:3849261906471:NO:USERNAME:Madhura

    Help, please.

    If there is another way to achieve the same thing please answer.

    Thank you

    Nilesh

    Hi Nilesh,

    You can use a Page element as a substitution variable in the body of the HTML message.

    for example, blah blah blah & P123_MY_PAGE_ITEM. blah blah blah

    The syntax is an ampersand in front of the name of page element and a point after the name.

    brgds,

    Peter

  • Regular expression to remove the space in the HTML tag

    Hi all

    My HTML string is as below.

    Select ' < CityName > RICHMOND < / Nom_ville >< StateCd > ABCD CDE< StateCd / >< CtryCd > CAN < / CtryCd >< CtrySubDivCd > BC < / CtrySubDivCd > ' double Str

    Output desired is

    < CityName > RICHMOND < / Nom_ville > < StateCd > ABCD CDE< StateCd / > < CtryCd > CAN < / CtryCd > < CtrySubDivCd > BC < / CtrySubDivCd >

    I want to remove these spaces of the tag value box with only spaces otherwise leave it as what. Please help to implement the same using regular expressions.

    Hello

    We don't know what you want.  This site seems to be formatting your message in a weird way.

    As the statement

    SELECT «...» "THE DOUBLE;

    without formatting, to show your entry and after the exact output desired friom as, with as little in shape as possible.  It might be useful if you use some character like ~ instead of spaces (just for viewing; we will find a solution that works for spaces).

    To remove the text which consists of spaces and nothing else between the tags, you can say

    REGEXP_REPLACE (str

    , '> +<>

    , '><>

    )

    How is this string generated?  Maybe there is an easier and more effective way to keep the bad wrtings sub off the chain in the first place.

  • Regular expression to remove space after the tag &lt; a... &gt;?

    Hello

    I'm relatively new to using regular Expressions, but am in need who will help me find all the tags < a... > with space immediately after this tag and replace it with the exact same tag, but not space after the tag < a... >.

    Thus, for example, a regular expression that there is:

    < a href = "somelink.html" > Somelink < /a >

    as well as:

    "< a href =" # "MM_swapImgRestore" onmouseover = "MM_swapImage (' sub-nav_button_professional_portal',", ' images/sub-nav_button_ professional_portal_f2.png', 1 ') "> Somelink < /a >

    And just remove the space in the hyperlink.  Does anyone know how to do this?

    Find-

    \ (.*)\

    Replace-

    $2

    Post edited by: Murray * CPA *.

  • Use regular expressions to extract .llb file from the path name

    I'm trying to be smart (always a dangerous thing) and use a regular expression to extract the name of a library to a filepath converted to a string.   While I appreciate there are other ways to do this, regex seems to be a very powerful way of neat, I would be able to operate.

    IE, if I have a string of type, C:\applications\versions\library.llb\toplevel.vi, I want to be able to extract the library.llb of the string, because it will be of variable length, may include the numbers & spaces and may be located in a file of variable depth hierarchy.   In other words, I want to extract the part of the string between the last-which ends with .llb

    The best I managed so far is \\+.*llb who all returned less the drive letter and the toplevel.vi

    Can someone help me to achieve this goal, or I'm better by using an alternative method (for example filepath string in array, search for .llb)

    Thank you

    Matt

    Hi Matt,

    attached you will find two other options.

    Mike

  • Best way to remove a part of the description of the virtual machine?

    Hello

    With much help from Lucd, I created a script to add the version of the tools in the description.  It works fine, but the problem is that once he has run and added the version if it is run again, it simply adds the version once again.  I want to run this script on a schedule, once a night so little time I'll have a full description of the version of the tools

    I have an if - execution of another OK but I want to do is remove the text of version pre-existing tools and then add the new.  See where I've 'done' on the fi.  It is where I want to get magic that willdo what I have to do.  I can not just blow all of the description because people have a habit of describing their servers it

    $vm = get - machine virtual VMNAME

    $description = $vm. Description

    $date = get-date-format d

    $version = ($vm |) Get - View).config.tools.toolsVersion

    If ($description - match 'Tools worm') {virtual Set-machine - VM $vm - Description ("Already done" + "" + $description)-confirm: $false}

    Else {virtual Set-machine - VM $vm - Description ("Tools $date $version worm." + "" + $description)-confirm: $false}

    Any suggestions?

    This is the date format. With my locale, I 31/03/2009 and you have 31/03/2009.

    So, if you use the regular expression

    '^Tools ver at (\d{2}/\d{2}/\d{4}) (\d+)\. (.*)'
    

    This should work for you use the date format.

  • How can I get rid of the highlight of the part of the url?

    Part of the address (mozilla.com of https://support.mozilla.com/en-US/questions/new?product=desktop & category = d4 etc.) is highlighted. Why? It feels like a bike to safety wheels. This 'device' should become optional. I want to see the full address in the same impression. One of the reasons why I stopped using Opera is because of their partial URL cloaking, please don't go the same route.

    This is a new feature in Firefox to highlight the domain in the URL bar. You can change a preference to do the full URL darkness.

    Change a preference:

    1. type of topic: config in the location/URL bar and press ENTER.
    2. If you see a warning, accept (promise to be careful)
    3. Filter: browser.urlbar.formatting.enabled
    4. in the lower panel, double click on this item to toggle the value false

    I don't know if yes or no you must restart Firefox after doing the above to have the change take effect. Test, and if it does not, then restart Firefox and test again.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You must update some plug-ins:

  • part of the url is hidden

    Say the URL is https://google.com only https://google.c is visible (to note that half of c is no longer visible), but my address bar is so long enough to accommodate the text of three or four times of these URLs.

    Hello, in fact do you have a notebook with a fingerprint reader and authentec truesuite (can be re-branded with a different name by your manufacturer)? If so please try to update to the latest version or in the case where this does not work, or you may need to contact the support of truesuite directly, as in the other thread, we have already passed the firefox all troubleshooting procedure available and it seemed that no tweak or setting in firefox might cure the problem...

  • Why is the largest part of the URL, with the exception of the domain name, in cast iron? It is difficult to read. I would like to make the entire address in black police

    Screenshot of the behavior

    Before that I've upgraded to Firefox 6.0, the URL was displayed in black text.

    After the upgrade, it is now showing only the main domain name ( mozilla.com, for example) in the text in black, so that any additional text (like, https://support.) is grayed out.

    It is very difficult to read this gray text on my monitor. I would like to make sure the full address is displayed in black text, but I couldn't find any type of configuration setting under Options to change that.

    Please let me know if I can change the display of the URLS back to black.

    This is a new feature in Firefox to highlight the domain in the URL bar. You can change a preference to do the full URL darkness.

    Change a preference:

    1. type of topic: config in the location/URL bar and press ENTER.
    2. If you see a warning, accept (promise to be careful)
    3. Filter: browser.urlbar.formatting.enabled
    4. in the lower panel, double click on this item to toggle the value false

    I don't know if yes or no you must restart Firefox after doing the above to have the change take effect. Test, and if it does not, then restart Firefox and test again.

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You must update some plug-ins:

  • Encode the part of the URL (search)

    I want to be able to do a search on Google in a webview, by setting the URL "'https://www.google.com/search?&q= ' + 'Search'."

    The problem is that if the query contains a sign, + it get interpreted as a space (which is happening in a few popular applications, including the browser of evolution).

    I read that encodeURIComponent should solve this problem, so I changed the code for "'https://www.google.com/search?&q= ' + encodeURIComponent("+"), but research that results is actually % 2B."  Strangely, when I type the resulting URL in my computer, I get the correct result (a search of +).

    import bb.cascades 1.2
    
    Page {
        property string search: "https://www.google.com/search?&q=" + encodeURIComponent("+")
        Container {
            TextField {
                text: web.url
            }
        WebView {
            id: web
            url: search
        }
        }
    }
    

    This is the minimum project, I used to test my code.

  • Z10 BlackBerry how to remove a part of the application do not forget

    I love the Remember app on my Z10 but I would delete the "old".  I don't see a way to do this.  Does anyone know how?

    Prolonged pressure on an item or folder will slide from the right menu. At the bottom is Bill rash can. Press to remove.

  • How to remove a part of the list watermark in menu export

    Hi guys

    I have a list in the menuEdition watermark. but it is not delete button as a manager of the screening.
    So, how can remove my watermark list useless. Thanks for any answers in advance.

    LR_Q.jpg

    It is also a quick way to remove the watermark in bulk. Via LR preferences, presets, click the button go to the Presets folder and in there is a subfolder of watermarks. You can delete items from here, and they're going to be missing when you restart Lr.

  • Help, please.  How to remove a part of the reference?

    Sometimes, I need to use an old indesign document to another book. It's easy and fast. You don't need to set notes, running headers, templates etc.

    I still have the problem with books with indexes on the inside.

    It is easy to delete an old text from the document and fill in a new text.

    But if an old document index, such reference as 'see' 'See also' remains still etc. left (restored).

    Are listed in the index palette stil.

    And I do not know how to remove them automatically from my old document before importing a new text to it.

    Probably someone of you can write this simple script that can delete all index reference (or particularly like 'see' and see also") of the blank InDesign document.

    I mean empty indesign document, which is the document without the body of the text inside.

    Thanks in advance for your help and sorry for my bad English.

    try {}

    app.activeDocument.indexes [0].topics.everyItem () .remove ();

    } catch {} (_)

    }

Maybe you are looking for