Quick regex "link" question

I need to extract the link and the links anchor text from Strings which take the following format:
Bestsellers
Or
Find Gift
(I.e. has more attributes other than the "href" attribute)
I have the following regex:
<a\s+[^<>]*?href\s*=\s*["'](.*)["']\s*>(.*?)</a>
However, although, this works fine for the first example above, it does not match the second example correctly. Instead the "link" it matches comes out as:
/gp/product/" id="gift" name="findGift
When it should be:
gp/product/
I thought my regex pattern says "extract the link (everything between) the two quotes after "href=" but it seems to match any other attributes which may be inside the "<a>" tag.
Could someone explain where I have gone wrong.
Thanks

Watch out with those .* things. Try this one:
&#60;a\s*href\s*=\s*['"]([^'"]*)[^>]*>([^&#60;]*)&#60;/a>

Similar Messages

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • Authorization for work center /quick create links

    Hi all;
    I need nondisplay of bupa details:
    no Masterdata (no authorization to search/display/create any BUPA), no workcenter, no quickcreate links.
    the problem is  I have one  CRM Webclient Business Role and  I should manage this with 2 different pfcg role :
    One of them should use workcenter and quick create links but the other should not see them.
    I have handled not to search/display/create any BUPA via authorization object but
    not to display workcenter and quick create link I need another authorization object..
    Is there anybody who knows how can it be done by pfcg role ?
    Thanks
    belgin

    hello  Urvi;
    thanks for your helpfull answers.
    I have handeled it via UIU_COMP object and following componen name/plug/window name.
    COMP_NAME :WCC_SRV_ACC_PRO
    COMP_PLUG: DISPLAY
    COMP_WIN: MainWindow
    regards
    belgin

  • Enhancement request: Quick edit links for column attributes

    It would be really nice if columns in report regions had that little Quick Edit icon (turned on by Show Edit Links on the developer toolbar) to go directly to the Column Attributes page.
    It gets to be a real pain to click on Edit Page, click on the Region, then Report Attributes, and finally click on the Column to get to that point!
    Thanks

    quick edit features will be greatly enhanced in the next version
    Carl: By "next version", are you referring to Version 3.0? Your response was prior to 2.0 being released but I don't see any enhancements in this area in either 2.0 or 2.2. [Well, yes, the Quick Edit link image has changed but that's about it!]
    Can you clarify what you meant? Thanks

  • I have what is hopefully a quick and easy question. I kno...

    I have what is hopefully a quick and easy question. I know almost nothing about this stuff so go easy on me . All I need to do is find out if my DHCP is enabled. I'm having problems with my Xbox 360 and one of the possible problems is this DHCP thing. However I have no idea how to find the settings for my router on my computer. If it helps I have a Wirless model BEFW11S4. Thanks in advance for any help.

    You need to access your router to check if the DHCP is on.  To access the router open your browser and type in http://192.168.1.1 into the address field and hit enter.  That should open the routers log on screen and by default the user is left blank (some routers it is admin) and the password is abmin.  If you changed your routers password as you should for security reasons then use that password.  That will bring you to your routers user interface and on the main set up page should be your DHCP.
    Richard Aichner (Ikester)

  • Safari broken image link question mark in a blue box icon

    The url I get the safari broken image link question mark in a blue box icon most often is "apple.com/startpage/". There may be 10 or 12 of them. However, most apple.com pages have at least 1. In fact I am looking at 1 right now. I have emptied the cache. I do not wish to reset Safari because I do not want to reenter all of the passwords to various sites. Is there a simple answer?
    1.8 Ghz Power PC G5   Mac OS X (10.4.3)   Safari 2.0.2

    Hi Rex,
    Who is your ISP and what addresses do you have set in the DNS section of your System Preferences -> Network preferences?
    Have you tried logging into a different user account on your machine to see if that has the same problem? This will help us to know whether your problem is local to your account or system wide. If you don't have another account you can use System Preferences -> Accounts -> [+] to create a test one (and [-] to remove it if needed)
    Also, do you use any third party internet software (Norton, Intego, etc.)?

  • Quick Regex question

    This is a php Regex, but I have a feeling I can find help here...
    I am using this code to convert a [email protected] to <a href="mailto: ..">
    I want to modify it so if there's already a <a href="mailto:...> it will not change it
    My current code is:
    $text = eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})","<a  href=\"mailto:\\1\">\\1</a>", $text);Help please.
    www.MathLessons.com - When the numbers don't add up.

    This is a php Regex, but I have a feeling I can find
    help here...
    I am using this code to convert a
    [email protected] to <a href="mailto: ..">
    I want to modify it so if there's already a <a
    href="mailto:...> it will not change it
    My current code is:
    $text =
    eregi_replace("([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[
    a-z]{2,3})","<a  href=\"mailto:\\1\">\\1</a>",
    $text);Help please.
    www.MathLessons.com - When the numbers don't add up.Dude... why the hell are you using regex here? There's no point.
    if (!strstr($text, 'href="mailto:"')) {
        $temp = $text;
        $text = '<a href="mailto:"'.$temp.'">';
    }

  • Very quick regex question

    Hi everybody,
    I can't seem to figure this out in regex, but can anyone tell me how to use String.split to split a string on every second space?
    So, basically, turn this:
    aaa bbb cccc dddd eee fff
    into:
    aaa bbb
    cccc dddd
    eee fff
    Thanks!
    Jezzica85

    jezzica85 wrote:
    Wow! That is by far the craziest regex I've ever seen, but it works like a charm. Thank you promethuzz!You're welcome.
    I would never have come up with that on my own, but I did try. I have to say, though, I still don't quite understand all of what's going on in that regex. Would someone please mind explaining one more time what the parts are, and what they do?
    Thanks so much!
    Jezzica85Did you see reply #6? It pretty much sums it up. In order to understand it, you do need to have a basic knowledge of regex though.
    Here's some extra info:
    a(?=b)       positive lookahead, matches "a" only when followed by "b", see: http://www.regular-expressions.info/lookaround.html
    \\s          a white space character
    \\S          a non-white space character (anything but a white space character)
    $            the end of the line/String

  • Quick CSS box question

    Hi guys,
    Firstly a very Merry Christmas to you all !
    I'm just getting to grips with converting all the text on my
    site to CSS and have a quick question.
    On some of my pages I add an 'Also see' links box aligned to
    the right - it's a CSS div tag thingy someone kindly talked me
    through once. All of my pages are built from a template with an
    editable region.
    My question is, can I add this box (perhaps with a standard
    'Also check out' title and then spaces for my links) at the
    template level? This will save me having to go to Insert>Layout
    Objects>DivTag on every page. I've tried simply adding this to
    the editable region of the template but it simply pushed the
    editable region box over to the right and then didn't appear on my
    pages
    Also, the links box would ideally appear about half way down
    my pages on the right...
    Hope you can help, many thanks in advance!
    James
    Here's an example page where I have manually added my link
    box on the right of the page...
    http://www.fyrne.com/james_journalism/Pages/Mosaic_of_the_med.html

    Your CSS link implies that the CSS file is in the Templates
    folder. You
    shouldn't have anything there other than the template (dwt)
    files
    themselves. Please move it out to any other location in your
    site.
    <link href="../../Templates/Box.css" rel="stylesheet"
    type="text/css">
    Changes made to template editable regions would not propagate
    to existing
    child pages - that's why you aren't seeing that addition in
    them....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "JamesFryer" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi guys,
    >
    > Firstly a very Merry Christmas to you all !
    >
    > I'm just getting to grips with converting all the text
    on my site to CSS
    > and
    > have a quick question.
    >
    > On some of my pages I add an 'Also see' links box
    aligned to the right -
    > it's
    > a CSS div tag thingy someone kindly talked me through
    once. All of my
    > pages are
    > built from a template with an editable region.
    >
    > My question is, can I add this box (perhaps with a
    standard 'Also check
    > out'
    > title and then spaces for my links) at the template
    level? This will save
    > me
    > having to go to Insert>Layout Objects>DivTag on
    every page. I've tried
    > simply
    > adding this to the editable region of the template but
    it simply pushed
    > the
    > editable region box over to the right and then didn't
    appear on my pages
    >
    >
    > Also, the links box would ideally appear about half way
    down my pages on
    > the
    > right...
    >
    > Hope you can help, many thanks in advance!
    >
    > James
    >
    > Here's an example page where I have manually added my
    link box on the
    > right of
    > the page...
    >
    http://www.fyrne.com/james_journalism/Pages/Mosaic_of_the_med.html
    >

  • Very Quick PF Input Question

    Hello.
    A quick question if I may. I am in diffs.
    What are/When to use the PF inputs?
    With regard to triggering data aquistiions, will wiring a +5V input to pfi0 work as a trigger?
    Thanks.

    Hello Brian. Thanks for the reply.
    I am using a 6071 card.
    PFI 0/AI START
    PFI 1/REF TRIG
    Perhaps I should be using the PFI 1 port?
    http://www.ni.com/pdf/products/us/4daqsc199-201_ETC_212-213.pdf
    Here is the link for the pdf of 6071
    Best Regards
    Thomas

  • Error 501; iTunes store shows no images-only underlined links/question mark

    When I open iTunes store, the images show only as boxes with question marks and the text shows as an underlined blue link. When I click on anything I get a Error 501 message. My iTunes library and connection with iPod are unaffected.
    I have tried to uninstall iTunes and Quicktime. I have tried uninstalling everything related to Apple/iTunes (including Bonjour) and reinstalling Quicktime by itself (was successful). Everytime I reinstall iTunes, the store appears the same way and is inaccessible. Please help!!

    I have the same problem with our system. I contacted the Apple Help Department and they tried to help me via email (same fixes, uninstall, reinstall - same problem), but the problem persists. I can't preview the songs either and would like Apple to step up and help us all out!

  • 32 bit vs. 64bit download link question

    My daughter just bought a prepaid CC student and teacher license for her studies.  She bought it thru thinkedu.com and it is the $199.00/12 month subscription.  Her computer runs windows 8 pro 64 bit OS.  The download link says 32 bit.  I want to help her install it this weekend and have not clicked on the link yet to install.
    Two questions.  1) Will the 32 bit link be a problem in getting the best possible performance out of her computer (hardware aside)?  2) does the subscription begin when activation begins or is the meter running right now?

    Audio and video apps are mostly 64 bit only - Audition included.
    http://www.adobe.com/au/products/creativecloud/faq.html#desktop-products
    Which desktop applications in Creative Cloud require 64-bit operating systems?
    With the new CC apps, most of the pro video and audio applications now require 64-bit operating systems to run. These native 64-bit applications include Adobe Premiere® Pro CC, Adobe Audition® CC, After Effects® CC, Prelude® CC, and SpeedGrade® CC. Flash Professional CC, Photoshop CC and Lightroom® also require 64-bit on Mac OS.
    Where 32 bit and 64 bit versions are available, both will be installed automatically. The 32 bit versions may occasionally be required to run older plugins, though in your daughter's case I doubt she'll ever need the 32 bit versions.
    The 64 bit version of each app should be the version which launches by default in each case,

  • SharePoint Online Drag and Drop to Quick Launch Links

    Hello,
    We're using a SharePoint document library to store invoices and an approval workflow to manage the approvals for payment. Once an invoice is approved and paid, they move the invoice into a Paid subfolder. Because there are a lot of invoices, the view
    stretches across multiple pages. When they're not on the first page of the invoice list, they can't use the drag and drop functionality to move the invoice into the Paid folder because the Paid folder only shows up on the first page of the list.
    I would like to be able to add a link to the Paid folder to the links on the left side of the window. I can add the link, and it works in that if you click the link it takes you to
    Shared Documents\Paid. But if you try and drag a document to that link, it wants to place it in the root Shared Documents, giving you an error message that the file already exists in that location.
    How can I create a quick link to a subfolder of Shared Documents that also allows drag and drop functionality?
    Thanks,
    Adam

    Hi Adam, here are a few solutions:
    1. Use "Open with Explorer."
    2. Use the Content Organizer to automatically move the documents.
    3. Create a workflow to automatically move the documents.
    4. Create another view or library on the same page with the Paid folder in it.
    5. DON'T USE FOLDERS!
    (sorry, they're a big pet peeve of mine because of all the problems they create. They're also completely unnecessary with only one exception.)
    cameron rautmann

  • HT2729 is it normal for itunes to open when I click on quick times links?

    I just installed a new version of Quick Time Player after I uninstalled it
    I have not used it for a long time.
    Everytime I click on something to view (like a HD Movie or new artist) I get re-routed to ITunes.
    I hate this !
    is this how it works now?
    I would like to be able to see new movie trailers, etc from the QuickTime player and not have to open I-Tunes.  That is ridiculous
    anyone have the answer to this

    It would appear that the links you are clicking on are to media stored in iTunes. Apple now serves up virtually all its material through iTunes which plays nice on OSX, I believe not so nice in Windows (probably a return favor for what is done to Mac users by Microsoft).
    iTunes is not purely a commercial venture. It also serves up an enormous amount of free and educational material, as well as allowing you to convert your own media to more usable forms on your computer or iDevice.
    I can understand Apple not wanting to maintain two libraries of what is essentially the same material. It helps sell stuff as well that the promotional material is only a click away for you to buy. Apple is a business and iTunes is free for a reason.
    Peter

  • A Few Quick Lenovo T410 Questions

    Hi all,
    I posted here quite a while ago about my 9 cell battery in my integrated graphics T410 only lasting up to 5 hours. I have yet to send the notebook in simply because I haven't been able to go without it. However, I plan to do so at the start of this next week. Before I do so I was going to swap out the 500GB 7200.1RPM hard drive I installed with the 250GB 5400RPM drive that came with the notebook to see if it was an excessive power issue with the drive.This is where my worries are.
    When I inserted the 500GB hard drive into the drive tray, I had a very hard time screwing the tray in place. The screws were damaged in the process, and I have worries about taking them out, and putting them back in again. I am still under warranty.
    Am I able to recieve a new set of these screws?
    Also, 2 quick questions
    I plan on moving my 500GB drive into the slot where my optical drive is now, and putting a SSD in wheremy 500GB drive is located now. Do I need to buy anything special to make this work?
    I also plan on upgrading from the 2x2GB RAM I installed myself (machine came with 1x2GB), to 4x2GB. Is this RAM compatible?
    Thanks in advance.
    Solved!
    Go to Solution.

    FirstTimeLenovo wrote:
    Am I able to recieve a new set of these screws?
    Hi,
    I think only lenovo techs can determine or tell that, but my guess is that if they feel they need to be replaced, then they probably will.
    FirstTimeLenovo wrote:
    Also, 2 quick questions
    I plan on moving my 500GB drive into the slot where my optical drive is now, and putting a SSD in wheremy 500GB drive is located now. Do I need to buy anything special to make this work?
    I also plan on upgrading from the 2x2GB RAM I installed myself (machine came with 1x2GB), to 4x2GB. Is this RAM compatible?
    Thanks in advance.
    1. Yes, you would need this:- http://www-307.ibm.com/pc/support/site.wss/MIGR-73​170.html
    2. Yep, the RAM will definitely work.
    Hope this helps.
    Maliha (I don't work for lenovo)
    ThinkPads:- T400[Win 7], T60[Win 7], IBM 240[Win XP]
    IdeaPad: U350
    Apple:- Macbook Air [Snow Leopard]
    Did someone help you today? Compliment them with a Kudos!
    Was your question answered today? Mark it as an Accepted Solution! 
      Lenovo Deutsche Community     Lenovo Comunidad en Español 
    Visit my YouTube Channel

Maybe you are looking for

  • 11g on VMWare

    I understand that Oracle server is not supported on VMWare but this is just a test install and I am facing two major issues which I never faced in 10g under same environment. I have installed 11g RAC on a two node SLES 10 sp1 virtual machine. I am fa

  • Random mail delivery

    I am new to ipad. I had been receiving emails on the ipad changed locations (cities) and now have only received one email on the ipod which arrive this evening though several others sent at about the same time did not. I am able to receive email on m

  • Hi everyone I just got a IPhone 5s today and I had a 4s I can't find all of my apps how do I do this

    Hey I got a IPhone 5s today and I have tried to load my apps from my IPhone 4s onto the new one but i am missing stuff

  • Logging the Airport Extreme Model MC340LL/A and OS X 10.6.2

    I followed the directions here: http://support.apple.com/kb/TA21492?viewlocale=en_US I got this error and no log. $ sudo syslogd -m 0 -u 475 launchd checkin failed Any ideas? Thank you for your help : )

  • Elements 11 Preview Window not visible in dual monitor mode

    When I go to dual monitor mode the preview window is hidden. I can still hear the audio from the clip but I can't see the video window. It is still hidden when I switch back to single monitor mode. The only way to bring it back is to close out the pr