realbasic-nug
[Top] [All Lists]

Fun with RegEx replacement patterns

To: REALbasic-NUG <realbasic-nug@lists.realsoftware.com>
Subject: Fun with RegEx replacement patterns
From: Kem Tekinay <ktekinay@mactechnologies.com>
Date: Sun, 28 Dec 2008 21:35:17 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Thread-index: AclpXhXHQJ4bgydZBk+b3M7dSf+klA==
Thread-topic: Fun with RegEx replacement patterns
User-agent: Microsoft-Entourage/12.15.0.081119
Before I file a bug report, I want to be sure that what I'm seeing is indeed
a bug and not a product of my limited understanding.

If I use the RegEx replacement pattern "\x209", I'd expect my match to be
replaced by a space and a 9 (" 9"). Instead, it's replaced by a tab (chr(9))
and nothing else. In fact, I could try "\x12345678abcdef20" and it will
disregard all the numbers but for the last two, and therefore replace my
match with a space (chr(&h20)).

Now, if I use "\40142, I'd expect a space followed by "142", or perhaps
whatever character is represented by octal 401 followed by "42", but instead
get a "b" (chr(&o142)) and nothing else. In other words, it disregards all
the numbers prior to the last three, assuming they are all valid octals. If
they aren't, e.g., "\0409142", then all numbers after the first non-octal
are disregarded. In this example, I'd get a space (chr(&o40)) and nothing
else.

This behavior seems wrong to me. What say you?

__________________________________________________________________________
Kem Tekinay                                                 (212) 201-1465
MacTechnologies Consulting                              Fax (914) 242-7294
http://www.mactechnologies.com                        Pager (917) 491-5546

  To join the MacTechnologies Consulting mailing list, send an e-mail to:
           mactechnologies_consulting-subscribe@yahoogroups.com









_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>