Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Basic wildcard for context query comparators

Hello,

I agree using wildcard would greatly help in some situations. However, I will use a slightly different (and simpler IMO) syntax for the second case. The first query would be '/board/cpu*' but the second one would be '/board/"cpu[*"' instead of '/board/"cpu["* which seems more natural to me. Note that this implies that the character '*' will now also have to be escaped in the "quoted strings" (currently only characters '"' and '\' have to be escaped).

In the ideal, I think we should use the glob() function to implement this (simpler syntax than regexp) - I don't know if it is available on most OSes but if it is not we can certainly have our own implementation-. The good thing is that the syntax proposed by Manuel fit with the glob() syntax and will not introduce backward compatibility issues.

Eugene, if you agree with this we can work on an implementation and make a proposal.

Didier


Coutand, Manuel wrote:
Hi,
 
It would be usefull to have a basic wildcard/regexp capability in the context query name and id comparators.
 
for example if I have a system with these three contexts:
 
/board/cpu[0]
/board/cpu[1]
/board/memory
 
I would like to be able to get my CPUs using a context query.
 
This could be achieved without adding the full regexp syntax just by for example handling a * at the end of a string as a wildcard
 
for example: contextquery: '/board/cpu*' would match both CPU contexts
also the context query parsing could be done so: contextquery: '/board/"cpu["*' too would match both CPU contexts.
 
What are your thoughts on such a wildcard?
 
Regards,
Manuel.
 
 


_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/tcf-dev

-- 
Didier Brachet, Principal Technologist, Wind River
direct (33) 297.427.286 fax (33) 297.424.550

Back to the top