realbasic-nug
[Top] [All Lists]

Re: Fun with RegEx replacement patterns

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Fun with RegEx replacement patterns
From: Eric Williams <eric@oxalyn.com>
Date: Sun, 28 Dec 2008 20:59:18 -0800
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
In-reply-to: <C57DA195.1C18A%ktekinay@mactechnologies.com>
References: <C57DA195.1C18A%ktekinay@mactechnologies.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Dec 28, 2008, at 6:35 PM, Kem Tekinay wrote:

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?

That looks like a bug to me. The \x operator should "eat up" the first two numeric digits that follow and nothing else (ditto with the octal operator).

Eric Williams
Oxalyn Software
http://software.oxalyn.com/

AE Monitor
http://software.oxalyn.com/AEMonitor/


_______________________________________________
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>