Reply to Re: !preg_match Regex not compiling

Your name:

Reply:


Posted by Kimmo Laine on 10/24/19 11:34

"jamen" <jamen@invalid> kirjoitti
viestissδ:439e5e34$0$2098$edfadb0f@dtext02.news.tele.dk...
> Kimmo Laine wrote:
>> The missing ) is here: /(\)/
>> since you are using the backslash, which is an escape character, it
>> escapes the ), but actually you should be using
>> /(\\)/
>
> actually, this regex is still broken. You start a group, but never finish
> it. If you wanted to match ) then it should be
>
> /(\\))/

I assumed the searched term was "\" and not "\)". Because then the closing
brace would have been there already, since it wasn't escaped. And when you
think about it, if the search was indeed "\)", then they both need to be
escaped "\\\)" and then surrounded with the grouping braces (\\\))... then
finally /(\\\))/ . Way confusing... o_O

When regular expression is used to solve a problem, you'll only end up with
having two problems instead of one.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid>

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация