I am having some trouble parsing one part of the following URL out:
http://port-80.********************************************.box.************.com/********/search/?sid=123875&brands=DELL|KROCKS&sort=popularity
I am trying to parse out the following: DELL|KROCKS.
So far I have the following regex expression which works to a certain extent:
/brands=(.*)[\&?]/
What the above does is if the & character is after the brands, it will get the following: DELL|KROCKS. However, if the & is not there, it will get the following: DELL|KROCKS&sort=popularity.
Is there any way I can fix this?