Question : populate a textbox with a URL

GreenGhost:
I read your answer with interest. I have a similar situation where i have a form with a text box. I am attempting to find a solution to populate this textbox from a link to a URL that contains parcel id. For example: http://www.anyapp.net/Default.aspx?ParcelID=HR12345 .

I would like to have my form capture this URL into a specific textbox.

ANY help would be greatly appreciated.
   

   

Answer : populate a textbox with a URL

Here you are.
Got an answer from Tim  Pietzcker


If you want to match a :-) that  is not preceded by "please ignore me", then you'd need a  negative lookbehind (?<!...) instead of lookahead (?!...).  However, JavaScript doesn't support lookbehind.  
So what you could do is to match (\bplease ignore me\s*)?:-\)  and then, if it matches, check whether the capturing group $1  is empty.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
<script type="text/javascript">
var re = /(\bplease ignore me\s*)?:-\)/;

function regexTest(string, assert) {
	document.write('<hr>')
  document.write(string)
  document.write("[")
  var res = string.match(re)
  document.write(RegExp.$1=="")
 
  document.write("]?" + assert);
}

regexTest("1. this is the first string :-)        ",true);
regexTest("2. :-)",true)
regexTest("3. another string:-)here",true);
regexTest("4. Ending a sentence with :-)",true);
regexTest("5. please ignore me :-)",false);
</script>
Random Solutions  
 
programming4us programming4us