Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

hash and args

  •  07-21-2008, 1:21 PM

    hash and args

    greetings,

     

     in javascript, i'm trying to pull out pieces of a url via regex. my url looks like this:

     

    http://domain.com/index.html#hash=http://domain.com/index.php?arg=val&arg2=val2&meta=val&meta2=val

     

    I want to be able to extract everything after hash= up until meta=. but i want it to go to meta= if it finds it, meta2 if it doesn't find meta, and until the end of the line if it finds neither of the meta args.

     

    i've tried this, to no avail: string.match( /hash=(.+)(?:&meta=|&meta2=)*/ )

     

    what am i doing wrong? many thanks!

    tr

View Complete Thread