Sorry to ask something so elementary, but I'm just not getting it.
suppose I want to match the value of parameter b from a URL like
http://www.abcd.com/?a=1&b=2&c=3
I can use this regex expression:
&b=(.+)&
and then pull the value of group 1.
But suppose the c parameter is not included - the URL is
http://www.abcd.com/?a=1&b=2
Then, of course, the & doesn't match. So I have to replace it with
either nothing, or \b, or \Z, or something equivalent. They all work.
What I *don't* get is how to OR those conditions together. If the
second condition were a character, then I could create a character
class. But even though "&b=(.+)\Z" works, "&b=(.+)[\Z]" does not.
I know there's something simple here I'm not quite getting. Can some
provide a clue? Thanks.