PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
newmember
Forum Contributor
Posts: 252 Joined: Fri Apr 02, 2004 12:36 pm
Post
by newmember » Mon Oct 04, 2004 9:36 am
can i use $ with alternation?
e. g.: "/(zoom|$|age)/"?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Oct 04, 2004 9:42 am
no. $ is a regular expression metacharacter. It needs to be escaped.
newmember
Forum Contributor
Posts: 252 Joined: Fri Apr 02, 2004 12:36 pm
Post
by newmember » Mon Oct 04, 2004 11:46 am
that was my intension....i want to use $ as metacharacter in above regex
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Oct 04, 2004 11:49 am
then why not try it instead of asking us?
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Tue Oct 05, 2004 2:34 am
For regex it also helps if you spell out a bit more what you are trying to match...
Mac