Wildcard Search Example in C#

I want to do a wildcard search(* and ?) on a search box using the predicate library at 
http://www.albahari.com/nutshell/predicatebuilder.aspx
I am not sure if we can use the regular Expressions library in conjunction with the above predicate library to obtain the results.
Kindly point me to a few good resources on doing this efficiently(with or without using the above library)
Thanks,
K.V.N.PAVAN

You haven't explained the context of your question.
What you aim to achieve.
So it's guesswork trying to come up with an alternative to doing "this" when we don't really know what "this" is.
Looking at that
predicate = predicate.Or (p => p.Description.Contains (temp));
I would think you could combine that with the approach in the link:
https://msdn.microsoft.com/en-us/library/bb882639.aspx
Or maybe you could just use the approach there and forget predicatebuilder.
One approach I use is to build a list of predicates and use trueforall.
I have a wpf sample uses this approach
http://social.technet.microsoft.com/wiki/contents/articles/26673.wpf-collectionview-tips.aspx
You could adapt that approach into a linq extension method, or maybe use it as a filter like I do in that article.
private List<Predicate<Person>> criteria = new List<Predicate<Person>>();
private bool dynamic_Filter(object item)
Person p = item as Person;
bool isIn = true;
if (criteria.Count() == 0)
return isIn;
isIn = criteria.TrueForAll(x => x(p));
return isIn;
Please don't forget to upvote posts which you like and mark those which answer your question.
My latest Technet article - Dynamic XAML

Similar Messages

  • Wildcard Search requirement for Items description and BP Name

    Hi Friends,
    I want to know is there any feature in Item Master data or Business Partner Master Data in which search is done by putting middle or last name. For example the Item Name is Electric Motar 345 Gear
    and when the user wants to search it by say Motar 345 then all items which inclused Motar 345 should come highlighted.
    Same for BP also its required as BP name is Glem Tex Japan Pvt Limited and now user wants to search the BP by say Tex Japan and all BP which includes the word Tex Japan should come.
    Is there any possibilities by which this can be achieved. Its somewhat wildcard search required. I heared its possible in B1.
    Regards,
    Kamlesh Gupta

    Dear Sridharan,
    I have exactly put the same as 'Motar 345 after Opening the Item Master Data and in find mode pressed * Enter and put the above in Find and selected Item Description. But sorry to say that nothing is coming and the cursor goes in the last item master data.
    What might be the problem can you please tell me.
    Regards,
    Kamlesh Gupta

  • Can't perform wildcard searches

    Hello world,
    We're using Portal 3.0.9.8.1 with Patch 1949492 installed. This is on 8.1.7.2.4 SE Database.
    When performing a search, cannot include wildcards. E.g. a search for 'test' returns only the exact word 'test'. It does not return 'testing','tester','test1','detests'.
    This is against what Portal's Own Help file states. Click 'Search Tips' on the 'Advanced Search Page' and you are told the following:
    The % character is interpreted literally, so do not include it as a wildcard. If you enter 100% as your search term, search finds content that contains the text 100%, not 1000 or 10000. Wildcards are automatically added to the beginning and end of your search term, so searching for 100 will automatically return content that contains 1000 and 10000.
    If interMedia is installed and enabled, search automatically uses the stem operator to search for words that have the same linguistic root as the specified word. For example, if you specified the word lift, the search feature will return content that contains the words lift, lifting, lifted, etc.
    Both of these statements are blatantly untrue as it does neither.
    Any thoughts Oracle? Has anyone else managed a wildcard search?
    Frustrated
    Dave

    I've just verified in 3.0.9 and wildcards are applied as specified in the documentation, when Text is not enabled. If your search term is 'test' then the SQL query will have the search term %test%. Literal % signs in your search term are escaped, so that if your search term was test% then the query would be for %test^%% escape ^.
    There are a few things to remember. When searching WITHOUT Intermedia Text enabled the search will only match terms in the title and description of the item.
    When, Intermedia Text is enabled, all of the content will be searched. However, as indicated in the documentation, the stem operator will be used. So if you search for 'test' the query is now a Text contains('$test') type query. The default operator is the '$' stem operator, which match terms that have the same linguistic root. So if your search term is 'test' it should match 'tests' or 'testing' or 'tested'. However, it will not match 'test1'. Please refer to the Intermedia Text documenation for more information on the stem operator and Text searching in general.

  • Wildcard searches for WBS element

    HI Experts,
    Can anyone give a example prgm for wildcard searches to WBS element LIPS-PS_PSR_PNR field.
    Thanks in advance.

    Hi,
    This is standard system behaviour. Purchase requisitions generated by MRP do not add to commitment. However, when these PRs are converted into POs, the POs add to commitment. Purchase requitions genertaed directly from PS, without the intervention of MRP always add to commitments.
    Regards
    Muraleedharan.R

  • Wildcard Search in CCW

    Is there a way to do a wildcard search in CCW when querying up a PO#?
    It would be helpful for my customer when querying orders because their PO#'s sometimes include letters at the end of the PO's like "OP" and sometimes they don't.
    For example PO# 4500151514OP maps to SO# 53654560 and comes up in CCW.  But when I try to do a partial search or wildcard search (4500151514 or 4500151514%) in CCW it won't pull up the SO#.
    Please let me know if wildcard searches are possible in CCW or if there was a work-around that could do this.
    Thank you,
    Tom Butalid

    Thank you for suggesting this.
    I tried this solution but am really confused why its not giving any output when I am giving like condition with presentation variable. Whereas if I directly give same value as in presentation
    variable, it returns all matching rows.
    When I saw the SQL generated (by giving presentation variable with like) by OBIEE, it was having "=" instead of "like value%'" whereas by directly giving the value in place of presentation variable, it applies "like 'value%'" only.
    Not sure why its happening, can you also try it once.
    Let me know if anyone has any other suggestion.
    Thanks
    One possible solution :
    - In your prompt set up a presentation variable
    - and in your answer create filter with a like condition, you presentation variable and the % wildcard an the end

  • Wildcard search of .so to load/run

    Hi all,
    I'm trying to write an diagnostic tool for work to run through some debugging diagnostic steps on the target system.  It's quite simple idea in that on execution it will gather silicon, system information, read fuses, registers, bootstraps, run basic read/writes to flash/storage, toogle gpios, dump etc.  The tool will also run through security api calls, open/close sec devices, calling and testing encrypting/decrypting APIs and testing different drm api calls.  However I don't want the main tool to have knowledge of these security api calls, i would like to be able to have helper .so's with knowledge of specific drm api in their corresponding helper .so.
    So ideally the tool should somehow dynamically load them by way of a wildcard search of all the helpers .so and execute each as it finds them.  I know with dynamically linking in sharedlibs, on execution, if it can't find the specific file a program would error out with message like "libcrypto.so.0.1 doesn't exist" or something like that, which i don't want to happen, I want the tool to continue and execute the rest of the diagnostic tests.  The tool should be able to dynamically search and execute whichever .so's that it recognizes and can find since I might have 5 different helper .so for different drm technologies but at any given time they might not exist within the filesystem due to licensing issues for different vendors.  Is there a way to do this?
    -vincent

    You can use the dl... C functions to load dynamic libraries at runtime. The dynamic loader does this for you when the program starts up but you can do it yourself. For example, in your shared library plugins, you could have common symbols (exported functions) for initializing, performing the test, checking the results, etc. The plugins would themselves link to the required libraries. These third-party libraries would then be loaded and linked automatically. You can set an RPATH in your main program to the plugin directory or use file access functions to search for them and pass absolute paths to dlopen. Or something like that.
    dlopen, dlsym, dlerror, dlclose are the C functions you need to load libraries. I found think link on google: http://www.ibm.com/developerworks/linux … index.html. You can use functions like glob and opendir to search for plugin files. glob uses wildcards. I'm assuming you're using C.

  • How to frame the select query for wildcard search.

    Hi Experts,
    I have an input field P_USERALIAS.This value could contain the actual value or the wildcard for example : user can enter P_USERALIAS as SAP123 or S or SAPABC123 . I need to generate a dynamic search on table USREFUS  depending on what has been entered.Please help.
    Useful answers will be rewarded.
    Regards,
    Shrita Sharma.

    THIS IS A TEST REPORT FOR WILDCARD SEARCH**
    TABLES: USREFUS.
    PARAMETERS: P_NAME1 TYPE string.
    RANGES: R_NAME1 FOR USREFUS-USERALIAS.
    DATA: T_usrefus LIKE usrefus OCCURS 0 WITH HEADER LINE.
    *replace
    if p_name1 cs '*'.
    replace all occurrences of '*' in p_name1 with '%'.
    SELECT * FROM usrefus
    INTO TABLE T_usrefus
    WHERE useralias like P_NAME1.
    else.
    SELECT * FROM usrefus
    INTO TABLE T_usrefus
    WHERE useralias = p_name1.
    endif.
    LOOP AT T_usrefus.
    WRITE: / T_usrefus-useralias.
    ENDLOOP.
    **THANKS & REGARDS
    SHRITA SHARMA.

  • Wildcard search fails

    Using DS 5.2 I have noticed some anomalies in search results using wildcards.
    Searching, for example, for "pager=*1" returns all the correct entries but also all the entries with NO pager number specified. The same happens for any single int after the wildcard, (but not a double int. EG "pager=*99" returns the correct anticipated result set).
    This also happens with other attributes such as homephone and email.
    Has anyone else come across this?
    Thanks in advance for any help.
    Regards
    DB

    I have heard of this before but never seen it myself. I tend to use older, patched up versions of DS (e.g. 5.1SP3) for reasons just like this.
    The previous cases were 1) a bug in the search algorithm was not handling wildcard searches with a small number of characters correctly if they were rooted at the beginning or the end of the string or 2) the indexes for multi-valued attributes were screwed up and the only solution was to get a patch and rebuild the indexes.
    In both cases it was a bug. I think #2 implied that the entry had a previous value that matched the search, but the value had been deleted and the index was not updated properly. If this attribute is indexed you could try deleting the index and recreating it to see if the problem goes away.

  • Wildcard Search on Set

    Hi
    I am trying to iterate through a Set and output all values that matches a partuclar string or subsrting.
    e.g. if create a Set and insert the following values:
    Set<String> alf = new HashSet<String>();
    alf.add("abc.cde.fgh.ijk");
    alf.add("abc.zxy.fgh.ijk");
    alf.add("abc.pqs.tws.ijk");I am tring to display the above values (example) based on a wildcard search e.g:
    If I search for:
    abc.?.?.ijk
    I will get an output containing the above results, (? implies matach any).
    abc.cde.fgh.ijk
    abc.zxy.fgh.ijk;
    abc.pqs.tws.ijk
    Thanks

    I am looking for clear and solid example of how to achive the following.
    For example:
    I have the following ip's in a Set:
    111.112.113.114;
    112.113.114.114;
    111.112.113.115The values are all consistant IP format.
    now when I search for say *.112.113.* through the standard inputI want to get back:
    111.112.113.114
    111.112.113.115          e..g match the 2nd and 3rd octets and perform wildcard search on 1st and 4th octets
    and
    *.*.*.* <-- will output all IP addresses
    * = wildcardThanks
    Edited by: Apprentice12 on Apr 10, 2010 4:01 PM
    Edited by: Apprentice12 on Apr 10, 2010 4:02 PM

  • Wildcard search + thesaurus on xquery

    Hi All,
    I just realized that thesaurus matching is not supported with wildcard search.
    Here is current codes.
    <Searches>
    if (fn:exists(http:get-query-parameter("Ntt"))) then
    for $paramNtt in http:get-query-parameter("Ntt")
         return <Search Mode="AllPartial" Key="i_products_st">{concat("*",concat($paramNtt,"*"))}</Search>
    else ()
    </Searches>
    So, now i am thinking that I can change to somthing like following eql
    <EqlExpression>
    collection()/record[ endeca:matches(.,"i_products_st",$paramNtt,"AllPartial") or endeca:matches(.,"i_products_st",concat("*",concat($paramNtt,"*")),"AllPartial") ]
    </EqlExpression>
    though I didn't test it out yet. I guess there might be some other solution.
    So, I would like to ask if any better way can solve this issue.
    Thanks,

    Are you trying to retrieve the union of (a) records that match the user's search term as literally entered, perhaps expanded by thesaurus and (b) records that match the user's search term as a substring via wildcard?
    If so, then EQL can express that logic. For example, suppose that:
    * the thesaurus contains an entry "truck" <-- --> "lorry"
    * the user enters "truck" in the search box
    EQL: collection()/record[ endeca:matches(.,"i_products_st","truck","AllPartial") or endeca:matches(.,"i_products_st","\*truck\*","AllPartial") ]
    This search filter expression would match records containing: { truck, lorry, trucker, trucking, struck, ... }
    This kind of infix wildcard expression has very broad recall. In this case you would probably also want to assert a relevance ranking strategy based on matching the user's original entry "truck", using Nrr.
    Also worth thinking about search inputs that are multiple words like "truck driver" - would you want to implicitly wildcard every token separately e.g. \*truck\* \*driver\*
    Finally, definitely worth thinking about search inputs that give pathological queries when implicitly wildcarded, like very short tokens e.g. a ==> \*a\*

  • Oracle BI Publisher - Passing multiple wildcard search to a bind variable

    Hi,
    Please help me in resolving the below mentioned issue:
    I have developed a report in oracle BI Publisher with a SQL query.
    While scheduling the report to run I used to pass mutilple parameters like CGAMSVC08,RLCSVC51
    If the pass the parameter with wildcard search like C% it works.
    When I pass two or more parameter values with wildcard search like C%,R% its not working.
    Could you please let me know how should I give the bind variable in the SQL query. Currently I'm paramater like the one shown below for passing multiple paramaters:
    Where (',' || :PRMRETRID || ',' like '%,'||RL.RETROFIT_ID|| ',%')
    Edited by: user1101445 on May 23, 2012 2:02 AM

    HI Tyler.
    Well, here's the latest.
    I found this little gem in the BIEE 10.1.3.3.3 Release Notes Documentation...
    This issue applies to Versions 10.1.3.3, 10.1.3.3.1, 10.1.3.3.2, and 10.1.3.3.3.
    Reports that use the BI Publisher data template as the data model may fail with the
    following error: "Data not defined."
    This error will occur if you defined a parameter in your data template but you do not
    pass a value to it via the user interface. If you do not specify this parameter in the "Parameters" section of the report definition that you created using the BI Publisher Edit Report interface, then you will receive the error.
    To work around this issue, either define the parameter in the Edit Report interface or remove the parameter from the data template.
    That bit is now working.
    Having set this up and using your guide it works if my SOAP parameters declaration passes a single value like this...
    <parameterNameValues>
    <item>
    <name>P_INVOICE_ID</name>
    <multiValuesAllowed>true</multiValuesAllowed>
    <values>
    <item>16641</item>
    </values>
    </item>
    </parameterNameValues>
    But if I try and pass two or more like this...
    <parameterNameValues>
    <item>
    <name>P_INVOICE_ID</name>
    <multiValuesAllowed>true</multiValuesAllowed>
    <values>
    <item>16641,18421</item>
    </values>
    </item>
    </parameterNameValues>
    BIP states "java.sql.SQLException: ORA-01722: invalid number"
    My SQL where clause is..
    <sqlStatement name="Q1">
    <![CDATA[select * from vw_invoice_summary
                   where invoice_summary_id IN (:P_INVOICE_ID)]]>
    </sqlStatement>
    And the BIP error records the parameter value as P_INVOICE_ID 16641,18421 (which are legit invoice IDs)
    In summary, works if I pass one invoice ID, fails if I pass two or more.
    Any ideas? Or do you reckon this is now a post for the BIP forum?
    Kind regards.
    Simon

  • SharePoint 2013 Online - Default Wildcard Search

    Is there a way I can change SP to always append a * to the end of every search?
    We're using the Online version (tied in with O365), and it has been requested that we have every search be a wildcard search by default. I found walkthroughs for SharePoint 2010, but the interface and menus have changed in 2013.

    You can edit the Search Results Web Part. Then from the web part properties, click on Change Query.
    Now in the popup modal window, click on "Advanced Mode".
    In Query text, you can use {SearchBoxQuery}*

  • Address Book wildcard searching LDAP

    With Address Book under Mac OS X 10.4 (Tiger), and 10.5 (Leopard) it was possible to do a wildcard search of an LDAP server for contacts. You did this by typing *. or ** in the search box in the top right.
    Unfortunately, this no longer seems to work in Address Book in Mac OS X 10.6 (Snow Leopard).
    Does anyone know of an alternative way of doing this?

    Do you use iCloud? If so, try going to the System Preferences then iCloud and unchecking Contacts. It will warn you about deleting the contacts from your Mac. If you know your other devices on iCloud have the correct contacts(or icloud.com) then this should be completely safe. Once you've okayed them to be removed, immediately recheck contacts.
    Please let me know if this works. Thanks!
    Autumn

  • How to do wildcard search?

    Does anyone know I can do wildcard search like *.jpg or my**.jpg? And yes, don't tell me to use the Terminal and copy and paste path.

    Spotlight searches are pretty much wildcard searches, you just don't need the wildcards.
    However, if you want to do it, look at a Raw Query. This post shows some of its capabilities using the Terminal command mdfind, but you can use a Raw Query in the Finder and he talks about how to select that from the criteria menu.
    http://blog.scottlowe.org/2012/07/25/advanced-spotlight-queries-in-the-mac-gui/
    With a Raw Query, you don't use the mdfind command, but the rest of the search is entered into the Find window.
    Also, see here: https://developer.apple.com/library/mac/documentation/carbon/conceptual/spotligh tquery/concepts/queryformat.html

  • Wildcard search in SharePoint 2013.

    Hi ,
    I have SharePoint 2013 farm, which is migrated from 2010 to 2013. After migrating to SharePoint 2013, wild card search is not working. Could someone please help me in activating wildcard search for already configured search service application in SharePoint
    2013.
    Thanks,
    Badri.
    Badri

    Hi
    I am trying to do a partial search without using wildcard by setting the query text of the search result source to {searchTerm}*. The search works and gives me the right results. However,
    the results look differently.
    When I do search for abcd*, the words that are started with abcd in the Title, Summary and Path parts are highlighted.
    And when I do search for abcd, I have exactly the same search results back. but the words are not highlighted. and besides that, the Summary text is different.
    I believe even if I had the right search result items back, the Title, Summary, and Path properties are created based on the searchEntry. Is there any way to make the items look exactly the same without manipulating with the searchEntry value?
    Thank you,
    Tatiana

Maybe you are looking for

  • New to iPhoto 09

    I am new at using iPhoto 09.  I currently use Picasa for all my photos on my mac, but since I now have Apple TV, I need to used iPhoto so I can view all my photos on my Apple TV.  Can someone recommend a book or other resources that I can use to lear

  • Creating a Static view link association creates a null entityImpl error

    294] {{ type: 'METAOBJECT_LOAD' Loading meta-object: myModel.view.assoc.DeptTypesFkLink [295] {{ type: 'METAOBJECT_LOAD' Loading meta-object: myModel.view.assoc.assoc [296] Loading from individual XML files [297] Loading the Containees for the Packag

  • Issue with Dynamic Link with Premiere CC and After Effects

    I'm having a strange and annoying issue with Dynamic linked clips in Premiere CC: When I render or export my timeline the progress will stall when it hits a dynamic linked clip.  It will stay stalled until I click the After Effects application and ma

  • 3000 H210 Card reader problem

    I have a 3000 H210 53553PU and the computer doesn't recognize the sd card in the reader. The drive indicator light come on when I insert the card , however, the card is not available for use. I would appreciate your input on this issue. Thanks, Pops

  • Bridging with AP1030 and Controller

    Hi I have a test enviroment with 2 ap1030 and i want to make a 5ghz bridge link with these two aps. this should be possilbe. but im not able to get it worked. i also didnt found a good documenation for this configuration. do i need to make both aps i