[Developers] pattern-matching syntax for =~ constraint in MQL

Ian Swett iswett at appliedminds.com
Tue Apr 22 23:42:52 UTC 2008


I'm interested in any updates to the pattern matching syntax as well.

In particular, the docs indicate that "love you" matches the phrase  
love you.  Is there a way to match the word love and you, but not as a  
phrase?

-Ian

On Apr 15, 2008, at 1:40 PM, David Flanagan wrote:

> Answering my own question here, it appears that using * in quotes,
> causes it to match a single word.
>
> So the pattern I should use in my query is:
>
>    "name~=": "\"^The *$\""
>
> The pattern ^*$ matches strings that are single words.  The pattern  
> * by
> itself seems to match anything.  I'm still not exactly sure what the
> matching rules are, but I can make the examples in my documentation  
> work
> again.
>
> 	David
>
> David Flanagan wrote:
>> The * in the query below used to match a single word:
>>
>> [{
>>   "type" : "/music/artist",
>>   "name" : null,
>>   "name~=" : "^The *$"
>> }]
>>
>> So this query would return The Clash, but not The Mighty Mighty
>> Bosstones.  That's changed: the * now seems to match any string.
>>
>> Can anyone tell me if there is any new syntax to match a single word?
>>
>> 	David
>> _______________________________________________
>> Developers mailing list
>> Developers at freebase.com
>> http://lists.freebase.com/mailman/listinfo/developers
>>
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list