RegExp.$1

This is a discussion on "RegExp.$1" within the JavaScript Forum section. This forum, and the thread "RegExp.$1 are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 30th, 2007, 20:19
Stormraven's Avatar
SuperMember

SuperMember
Join Date: Feb 2006
Location: $_home
Age: 19
Posts: 80
Thanks: 3
Thanked 0 Times in 0 Posts
RegExp.$1

I have worked with regular expressions before but have heard of regexp.$1 $2 and $3, what do they actually do and what are they used for?
Reply With Quote

  #2 (permalink)  
Old Oct 1st, 2007, 04:11
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: RegExp.$1

As far as I know $1, $2 and $3 etc.. is a way to reference the matches of a regex replace in PHP (and possibly other implementations).

If you want to replace something in a regex you can include the original source by using the associated match using $x.

I have not seen or heard anything that would use $1, $2 etc.. in javascript.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
regexp find and seperate custom tags in a string Chippo JavaScript Forum 6 Apr 24th, 2008 08:44


All times are GMT. The time now is 19:16.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43