Re: [PHP] Regexp Oddity

2004-03-11 Thread trlists
On 11 Mar 2004 Raditha Dissanayake wrote: > print "Matches: " . preg_match('/((?i)rah)\s+\1/', "RAH RAH") . "\n"; > print "Matches: " . preg_match('/((?i)rah)\s+\1/', "rah rah") . > > > is what you should use. Oh. Of course -- I knew it was obvious! This also works: pr

Re: [PHP] Regexp Oddity

2004-03-10 Thread Raditha Dissanayake
print "Matches: " . preg_match('/((?i)rah)\s+\1/', "RAH RAH") . "\n"; print "Matches: " . preg_match('/((?i)rah)\s+\1/', "rah rah") . is what you should use. [EMAIL PROTECTED] wrote: I must be missing something obvious ... I am trying to use backreferences in a PCRE regexp to check for a r

[PHP] Regexp Oddity

2004-03-10 Thread trlists
I must be missing something obvious ... I am trying to use backreferences in a PCRE regexp to check for a repeated character, but they don't seem to work. I've used regexps often before, but never needed backreferences. For example this: print "Matches: " . preg_match("/(a)\1/", "aa"