|
Posted by Kimmo Laine on 10/25/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>
Navigation:
[Reply to this message]
|