• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: wildcard Query
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wildcard Query


  • Subject: Re: wildcard Query
  • From: "Cheong Hee (Gmail)" <email@hidden>
  • Date: Wed, 10 Nov 2010 18:45:50 +0800

Hi Ken
 
So sorry that I misunderstood your question.  After spending some time, I think this is what you need.
 
       p = Pattern.compile("\\Q*\\E");
       m = p.matcher(input);
       if (m.find()) {
           System.err.println("test starts" +
                              " with * signs...input: " + input);
       }
But then the downside is you will have to enumerate each string one at a time.
 
Cheers
 
Cheong Hee
 
----- Original Message -----
From: ISHIMOTO Ken
To: Farrukh Ijaz
Cc: WebObjects Development
Sent: Wednesday, November 10, 2010 5:44 PM
Subject: Re: wildcard Query

Hi Farrukh,

Sounds nice, I will take a look at that and give you feedback.


On 2010/11/10, at 10:09, Farrukh Ijaz wrote:

Hi Ken,

I spent some time exploring all the possibilities at the EOF level but it looks like it does not work at the EOF level. I also inspected the PostgresPlugin and found that the escape character is "|" instead of "\\" but still it doesn't work. If your data is not very large, you can do something like this.

create your own custom class for EOQualifierEvalution called RegExpEvaluation as follows:

public static class RegExpEvaluation implements EOQualifierEvaluation {

String key, pattern;

public RegExpEvaluation(String key, String pattern) {
this.key = key;
this.pattern = pattern;
}

public boolean evaluateWithObject(Object obj) {
if (obj instanceof NSKeyValueCoding) {
Object value = ((NSKeyValueCoding) obj).valueForKey(key);
return (value instanceof String) && ((String) value).matches(pattern);
}
return false;
}

}

Fetch all the rows for the entity and using ERXArrayUtilities method as follows:

EOFetchSpecification fs = new EOFetchSpecification(M_User.ENTITY_NAME, null, null);
NSArray<ArticleDetail> eoz = session().defaultEditingContext().objectsWithFetchSpecification(fs);
eoz = ERXArrayUtilities.filteredArrayWithQualifierEvaluation(eoz, new RegExpEvaluation(M_User.NAME, ".*\\*.*"));

Hope this may help.

Farrukh

On 2010-11-09, at 8:33 PM, ISHIMOTO Ken wrote:

No

On 2010/11/09, at 15:48, Farrukh Ijaz wrote:

Try using "*[*]*" and see it works?

Farrukh

Sent from my iPhone

On 2010-11-09, at 5:34 PM, ISHIMOTO Ken <email@hidden> wrote:

Hi everyone,

I am fighting with a Qualifier and my Question is "Is there any way for query all Data with an  in."

DataSample :

Mike
Chuck
Dav*id
Ken

Like code bellow but the "*" is a Wildcard and won't work. 

EOQualifier qualifier = M_User.NAME.contains("*");

I would love to find any Record with "*".


Is there any trick or command to get all Objects with an "*" ?


Thank you

--------------------------------------------------------
K's ROOM      (ISHIMOTO Ken)
--------------------------------------------------------
[E-Mail]  <email@hidden>
[iChat:]   <email@hidden>
[HP]          http://www.ksroom.com/
_____________________________________________________________________
This e-mail has not been scanned for viruses because it was written on an Mac,
and there are NO Viruses on an Apple Computer.
For further information visit http://www.apple.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: wildcard Query
      • From: Mark Wardle <email@hidden>
References: 
 >wildcard Query (From: ISHIMOTO Ken <email@hidden>)
 >Re: wildcard Query (From: Farrukh Ijaz <email@hidden>)
 >Re: wildcard Query (From: ISHIMOTO Ken <email@hidden>)
 >Re: wildcard Query (From: Farrukh Ijaz <email@hidden>)
 >Re: wildcard Query (From: ISHIMOTO Ken <email@hidden>)

  • Prev by Date: Re: Expand and collapse a row
  • Next by Date: How to display a non-attribute form field that's embedded in a WORepetition
  • Previous by thread: Re: wildcard Query
  • Next by thread: Re: wildcard Query
  • Index(es):
    • Date
    • Thread