I have a text field and when the page loads, I need to wrap any websites listed in that field with an href tag.  www.google.com needs to be changed to   &lt;a href="www.google.com"&gt;&lt;\a&gt;   Not sure if this can be done with jquery or if I'd have to use regular expressions.
12603
I am using the function below to match URLs inside a given text and replace them for HTML links. The regular expression is working great, but currently I am only replacing the first match.  How I can replace all the URL? I guess I should be using the exec command, but I did not really figure how to do it.  function replaceURLWithHTMLLinks(text) {     var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/i;     return text.replace(exp,"&lt;a href='$1'&gt;$1&lt;/a&gt;");  }
110705
I'm trying to construct a hyperlink from a URL and a name in different cells.  a1 = http://www.example.com/ b1 = example c1 = &lt;a href="http://www.example.com/"&gt;example&lt;/a&gt;   What I want that is the URL in A1 to is made into a hyperlink with the name taken from B1:  &lt;a href="http://www.example.com/"&gt;example&lt;/a&gt;   I created a formula, but it's not working  &lt;a href=&amp;”=a1”&gt;&amp;”=b1”&lt;/a&gt;   should result in  &lt;a href="http://www.example.com/"&gt;example&lt;/a&gt;
117758
When I type a URL in angle brackets, such as &lt;;, in a comment, the URL is not detected and linked.  Supporting this would allow links to be used more naturally in the flow of text in a comment.  This notation is recommended for embedding URLs in running text by ; quotes are also recommended (I do not know if quotes work or not).
76495
For example, if I wrap my content with &lt;div&gt; tags (for no reason, just for arguments sake), would that cause a difference to search engines? Does thinner markup improve SEO?    &lt;body&gt;     &lt;div&gt;         &lt;div&gt;             &lt;div&gt;                 &lt;main&gt;                     &lt;p&gt;Text text text text text...&lt;/p&gt;                 &lt;/main&gt;             &lt;/div&gt;         &lt;/div&gt;     &lt;/div&gt; &lt;/body&gt;   versus  &lt;body&gt;     &lt;div&gt;         &lt;main&gt;             &lt;p&gt;Text text text text text...&lt;/p&gt;         &lt;/main&gt;     &lt;/div&gt; &lt;/body&gt;   versus  &lt;body&gt;     &lt;main&gt;         &lt;p&gt;Text text text text text...&lt;/p&gt;     &lt;/main&gt; &lt;/body&gt;   From an SEO standpoint, are these all equal or not?
117269
I'm managing a website that has a US section and a UK &amp; International section. Let's say these are divided as:   website.com/ website.com/us   The website has hreflang implemented correctly as follows:  &lt;link rel="alternate" href="https://www.website.com/us/" hreflang="en-US" /&gt; &lt;link rel="alternate" href="https://www.website.com/" hreflang="en-GB" /&gt; &lt;link rel="alternate" href="https://www.website.com/" hreflang="x-default" /&gt;   My questions are as follows:   Is it absolutely OK to have 2 annotations (en-GB and x-default) for the same page? Does Google have an official recommendation on this? And is there a chance / situation where this could become problematic? If the webmaster were to remove the en-GB annotation and just use x-default for all English versions other than en-US, would that adversely affect visibility and rankings in the UK?
33951
Im trying to craft a regex that only returns &lt;link&gt; tag hrefs  Why does this regex return all hrefs including &lt;a hrefs?       (?&lt;=&lt;link\s+.*?)href\s*=\s*[\'\"][^\'\"]+        &lt;link rel="stylesheet" rev="stylesheet"      href="idlecore-tidied.css?T_2_5_0_228" media="screen">     &lt;a href="anotherurl">Slash Boxes&lt;/a>   thank you
61207
I have a tag in my html like this:  &lt;h1&gt;My Website Title Here&lt;/h1&gt;   Using css I want to replace the text with my actual logo. I've got the logo there no problem via resizing the tag and putting a background image in via css. However, I can't figure out how to get rid of the text. I've seen it done before basically by pushing the text off the screen. The problem is I can't remember where I saw it.
27208
I have an HTML string representing an element: '&lt;li&gt;text&lt;/li&gt;'. I'd like to append it to an element in the DOM (a ul in my case). How can I do this with Prototype or with DOM methods?  (I know i could do this easily in jQuery, but unfortunately we're not using jQuery.)
12187
Does anyone know of a way or a program that will read a received email and recognize a static format of text (in my case it will be "#" followed by 6 integers), and make that a hyperlink to a webpage?   I have to think something similar exists. This would operate in the same fashion that when you type "www.google.com" and then hit Enter or space, it automatically converts this into a hyperlink. That is for a composed email, I'm looking for this in received emails.
36235
I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.  I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?  EDIT: The attribute filters allow you to select based on patterns of an attribute value.
8126
Something like .//div[@id='foo\d+] to capture div tags with id='foo123'.  I'm using .NET, if that matters.
123115
What's the best way to get a regular anchor (&lt;a href="..."&gt;) to submit the form it is embedded in when clicked?  &lt;form&gt;     &lt;ul&gt;         &lt;li&gt;             &lt;p&gt;                 The link could be &lt;span&gt;embedded &lt;a href="" onclick="?"&gt;at any level&lt;/a&gt;&lt;/span&gt;                 in the form, so "this.parentNode.parentNode..." is no good. :(             &lt;/p&gt;         &lt;/li&gt;     &lt;/ul&gt; &lt;/form&gt;   I know that the easiest way using jQuery would be  $('#myLink').click(function() {     $(this).parents('form:first').submit(); });   ...but I'm trying to find a way to do this without using a library.    Edit: I'm really trying to find a method which doesn't require knowledge of the form (eg: its name, id, etc). This would be similar to how you could put this on an input element: &lt;input onclick="this.form.submit()" /&gt;
24405
The tag  and meta-tag  syntax generate much nicer looking results than merely surrounding your tag with [square brackets].    However, they only work when you're talking about the site you're on.  On Area51, in Chat, and on Meta sites, this is frequently not the case, leading to attempts at syntax like [[tag:failure]](https://superuser.com/questions/tagged/failure), which produces:    Hmm, must be some subtle syntax thing:   : [tag:failure](https://superuser.com/questions/tagged/failure) []: [[tag:failure](https://superuser.com/questions/tagged/failure)] : [tag:[failure]((https://superuser.com/questions/tagged/failure))] : &lt;a href="https://superuser.com/questions/tagged/failure"&gt;[tag:failure]&lt;/a&gt; : [tag:failure][1] \n\n [1]: https://superuser.com/questions/tagged/failure : [more text is a [tag:failure] too](https://superuser.com/questions/tagged/failure)   I give up!  How can I create a link to a tag on another site with tag markdown?
82950
I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions in the code.  I've run across something in PHP that doesn't seem to have a java equivalent:  preg_replace_callback()   For every match in the regex, it calls a function that is passed the match text as a parameter.  As an example usage:  $articleText = preg_replace_callback("/\[thumb(\d+)\]/",'thumbReplace', $articleText); # ... function thumbReplace($matches) {    global $photos;    return "&lt;img src=\"thumbs/" . $photos[$matches[1]] . "\"&gt;"; }   What would be the ideal way to do this in Java?
7509
I try to write a simple Markdown parser in JavaScript. Therefore I want to check for the [link content][link id] syntax. I use the following code:  data = data.replace( /\[(.*?)\][ ]*\[([0-9]+)\]/g, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   It works well, but now I want to do this with a RegExp object. So I set up the following bit of code:  var r = new RegExp( '\[(.*?)\][ ]*\[([0-9]+)\]', 'g' ); data = data.replace( r, '&lt;a href="$2"&gt;$1&lt;/a&gt;' );   But it doesn't work. It even says that my regular expression (which works since the first example does a good job) is invalid:     unmatched ) in regular expression   I think it must have to do with some RegExp-object peculiarities I am not aware of. What am I doing wrong and how can the problem be solved?
65220
When closing a question as a duplicate there is a text box which says: "search, or enter a question link or numeric id". You can copy and paste a question link into here, but this fails if the URL starts with https:// instead of http://, with the message "Your search returned no matches; please try a different search".
94801
I have the following C# which simply replaces parts of the input string that look like EQUIP:19d005 into URLs, like this:  input = Regex.Replace(input, @"(EQUIP:)(\S+)", @"&lt;a title=""View equipment item $2"" href=""/EquipmentDisplay.asp?eqnum=$2""&gt;$1$2&lt;/a&gt;", RegexOptions.IgnoreCase);   The HTML ends up looking like this.  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19d005"&gt;EQUIP:19d005&lt;/a&gt;   The only trouble is that the destination page expects the eqnum querystring to be all UPPERCASE so it returns the correct equipment when eqnum=19D005 but fails if it receives eqnum=19d005.  I guess I can modify and correct EquipmentDisplay.asp's errant requirement of uppercase values however, if possible I'd like to make the C# code comply with the existing classic ASP page by uppercasing the $2 in the Regex.Replace statement above.  Ideally, I'd like the HTML returned to look like this:  &lt;a title="View equipment item 19d005" href="/EquipmentDisplay.asp?eqnum=19D005"&gt;EQUIP:19d005&lt;/a&gt;   Notice although the original string was EQUIP:19d005 (lowercase), only the eqnum= value is uppercased.  Can it be done and if so, what's the tidiest way to do it?