Ciaran,
A character class can be used to specify a set of characters
that can
be matched. The following will match ']' or '&':
[]&]
The ']' needs to be escaped, as it is a metacharacter part
of the
character class syntax. The '|' alternation character can
be used if
the options have more than one character. The following is
the way to
match ']' or '&' with alternation:
(]|&)
I hope this helps.
Jeff
On Dec 24, 7:18 pm, Ciaran <cronok... hotmail.com> wrote:
> Hi there,
> Can someone please explain to me how to phrase an 'or'
conditional in
> regexp? Using php, I need to rephrase this function to
search for ?
> v=(any chars) followed by either a ] square bracket or
an &
> ampersand.
>
>
preg_match_all("!?v=(.*?)]!",$result,$output);
>
> Thanks a lot,
> Ciaran
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|