Re: Inverse Regex Library?
Re: Inverse Regex Library?
- Subject: Re: Inverse Regex Library?
- From: "Eric Miller" <email@hidden>
- Date: Thu, 17 Jul 2008 16:34:33 -0400
So, you're trying to locate all things that look like a C identifier:
[A-Za-z_][A-Za-z0-9_]+ ?
How do you identify the too-many relationships? Is there a token for
it or is it something You see when you read the data?
Whatever tool serialized the data needs to interpret it to unserialize
it later, so you should be able to do something similar. Many
serializers use the target class structure to determine how to
interpret the data, basically the class structure forms the grammar.
In this case, even the unserializer doesn't know what it is looking
for until it hits a 'populate list of foo' operation and is then able
to identify the type of data in the serialized file.
You say that you are able to handle simple values, but run into
problems with the too-many relationships. Are there anything that
looks like a too-many that is not? What I'm asking is, if you can
identify everything that is not a too-many relationship, find them via
a process of elimination (if it's not something I can identify, then
it must be a too-many).
Eric Miller
On Thu, Jul 17, 2008 at 3:49 PM, Philip Mötteli
<email@hidden> wrote:
> Am 17.07.2008 um 20:57 schrieb Andy Lee:
>
>> On Jul 17, 2008, at 2:34 PM, Philip Mötteli wrote:
>>>
>>> I'm actually in a lucky position, because
>>>
>>> 1. The strings are not complicated at all.
>>
>> When you say they are not complicated, do you mean they are relatively
>> short, or that there is some regularity to them that might reduce the
>> problem from deriving a regex in the general case to something simpler? For
>> example, if you're writing a file-renaming utility and you're looking for
>> numbers within the file names, that's a simpler problem than the general
>> case. Are you able to say what the regexes will be used for?
>
> I try to analyze objects, that have been serialized using keyed encoding.
> As long as there are only simple values, I have no problem. But the members
> of too-many IVars are usually keyed by using something like
> "IVarName[0-9]+". I have to filter those out and classify as too-many.
> But I can't count on it. Not on the name nor where the number is. Or if
> there's a number. It could also be a letter.
> So it should come very close to the file-renamer.
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden