View Full Version : RegExp

01-27-2006, 05:11 PM
Hey all. Currently, I'm learning how to make scripts for InvisionFree (http://invisionfree.com) boards. Right now, I'm trying to build a script so my board has a store on it. The only problem is, I don't have enough javascript knowledge to do so. Here's the code I have right now, and what I need help on is RegExp.$1, both what it is, and how it can be used. I was told by a coder that it is used to grab the post count off of the showuser= page, but I'm not totally sure how to execute RegExp. If anyone can help me out with this, that would be great. Here's my current code:

var reqObject;
function getUser(url){
url ="http://s#.invisionfree.com/YOUR_BOARD/index.php?showuser=" + url;

if (window.XMLHttpRequest || window.ActiveXObject) {
reqObject= (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");

function get_post_count(){
if(reqObject.readyState == 4 && reqObject.status == 200){
/* You'll get the reqObject.responseText here, which is all the HTML
of the page.

01-27-2006, 07:39 PM
The RegExp.$x (where x is one of $, _, 0, 1-9, &, +, `, ') syntax is deprecated. It contained data having to do with the last regex match, but that data is now better accessed in the form of the array returned by RegExp.prototype.exec (or String.prototype.match if the regex has no global flag).

01-27-2006, 10:14 PM
I see no RegExp in your source code? What do you want it to actually do for you?

01-28-2006, 05:13 PM
Thanks for the RegExp info :)

I was messing around earlier, and I was curious if there was an easier way to grab info from a different location. Does anyone know of a way other than xmlhttp? It would make finishing this code a helluva lot easier.

Thanks again for helping :)

01-28-2006, 08:48 PM
Well, you could just query the data or call whatever the functions are to generate what you want, or include it etc