what the heck is regexp?!

wxdqz

New Member
I know enough javascript to get by...i've read the htmlgoodies tutorials etc. and i know c++

i don't, though, know this regexp command yet.

my little brother gave me this script for NeoPets that will help you rip-off people when selling stuff in neopets.

it makes it look like the price of what you're selling is $1 but you can really make it cost whatever you want.

anyways...the script goes like this:

var strSrc = mydoc.outerHTML;
var re = new RegExp ('10000', 'gi');
var strSrc1 = strSrc.replace(re, '1');
...
there is space here to add more replacement pairs of commands like the latter two
...
strNewSrc = strSrc60;
mydoc.outerHTML = strNewSrc;

the 10000 is the real cost...and the 1 is the fake one

could someone explain to me the regexp command?

what is that 'gi' thing?

i did a search on javascriptsource for scripts with it in them -- most if not all of the results came up refering to "patterns" and mostly email address validation.

Help,
John

ps...if anyone knows how the replace thing works also, i'm interested...
 
Back
Top