Topic awaiting preservation: Playing with RegEx in PHP |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: Berlin, Germany |
posted 04-11-2004 20:17
This is my current RegEx: |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 04-11-2004 20:44
well.. why would you have the char 0x1 in there? What's that \\1 supposed to do anyhow? |
Bipolar (III) Inmate From: Berlin, Germany |
posted 04-11-2004 20:53
The \\1 matches the contents of this (\\#{1,6}) group. The last hashes are optional. That's why i placed a ? after \\1. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 04-11-2004 21:13
oh I see. |
Bipolar (III) Inmate From: Berlin, Germany |
posted 04-12-2004 02:22
It means, that exactly the same string or nothing (because of the ?) is found there. The string should be #, ##,... ######. Not the number of hashes. I get the numbers of hashes with "strlen('\\\\1')" in the replacement string. (With the help of the option /e at the end of the pattern). |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 04-12-2004 17:39
I'm not at a computer were I can test this, but I think the following change would work |
Bipolar (III) Inmate From: Berlin, Germany |
posted 04-12-2004 19:04
Thanks, |