wildcards

wildcard characters in struts-config, version 1.1

My application is using struts 1.1. I'm trying to group URL forwards, using wildcards. For example, if the action is like this: action path="/edit/product" type="classname" forward name="success" path=".myapp.main" action Replacing the first line above with action path="/edit/*" type="classname" doesn't work. Any...

How can I support wildcards in user-defined search strings in Python?

Is there a simple way to support wildcards ("*") when searching strings - without using RegEx? Users are supposed to enter search terms using wildcards, but should not have to deal with the complexity of RegEx: "foo*" => str.startswith("foo") "*foo" => str.endswith("foo") "*foo*" => "foo" in str (it gets more complicated when...

Java Generics (Wildcards)

I have a couple of questions about java generics wildcards: 1) whats the difference between List<? extends T> and List<? super T> 2) What is a bounded wildcard and what is an unbounded wildcard? Thanks! ...

How to implement glob in C#

I don't know if it's legit at StackOverflow to post your own answer to a question, but I saw nobody had asked this already. I went looking for a C# Glob and didn't find one, so I wrote one that others might find useful. ...

SQL LIKE with no wildcards the same as '='?

I know this is a pretty basic question, and I think I know the answer...but I'd like to confirm. Are these queries truly equivalent? SELECT * FROM FOO WHERE BAR LIKE 'X' SELECT * FROM FOO WHERE BAR ='X' Perhaps there is a performance overhead in using like with no wild cards? I have an app that optionally uses LIKE & wild cards. T...

Leading wildcard character throws error in Lucene.NET.

If the search query contains a leading wildcard character (* or ?), the QueryParser's Parse function throws an error. Dim q As String = "*abc" Dim qp As New QueryParser("text", New StandardAnalyzer()) Dim query As Query = qp.Parse(q) Is there any way to solve this problem in Lucene.NET v2.0.0.4? ...

Windows API way to search subfolders with wildcards and other criteria in C++?

I think I saw once that it was possible to use the functionality of windows' search feature(s) in code. That it was possible to search for files using a sql query (something like "select filename from filestore where directory = 'c:\somedir' and extention in ('.doc','.txt','.me') and datemodified >= '2009-01-01 00:00:00'" Anyway, even ...

Example of using FindFirstFIleEx() with specific search criteria.

I asked about finding in subdirs with criteria. First answer was use FindFirstFileEx(). It seems the function is no good for this purpose or I'm using it wrong. So can someone explain how I would go about searching in a folder, and all it's subfolders for files that match (to give some sample criteria) .doc;.txt;*.wri; and are newer ...

What is the equivalent of java wildcards in C# generics

I'm developing an application where I the need to invoke a method of a generic class and I don't care about the instances actual type. Something like the following Java code: public class Item<T>{ private T item; public doSomething(){...} } ... public void processItems(Item<?>[] items){ for(Item<?> item : items) item.doSomethi...

How do I fix this Java generics wildcard error?

In this question, TofuBeer was having problems creating a genericized IterableEnumeration. The answer came from jcrossley3 pointing to this link http://www.javaspecialists.eu/archive/Issue107.html which pretty much solved the problem. There is still one thing I don't get. The real problem, as effectively pointed out by erickson, was ...

Mysql query with wildcard on number strings

I am trying to query a mysql table which contains strings of numbers (i.e. '1,2,3,4,5'). How do I search to see if it has '1' but not '11' bearing in mind if it is '9,10' '9%' doesnt work?? Fixed! (field like '10' OR field like '%,10,%' OR field like '%,10' OR field like '10,%') ...

Windows equivalent of ls * (asterisk) directory wildcarding?

Another question from an long-time Unix/Linux user who finds himself in a Windows world. First let me explain exactly what I'm trying to do. I'm using the Windows cmd.exe shell, and I want to list all directories below the current directory that contain a bin\Debug hierarchy, and determine if they contain any files (e.g.: trying to fig...

Fastest way to bruteforce a string using a DOS wildcard

This problem is similar to blind SQL injections. The goal is to determine the exact value of a string, and the only test you can do is to see if a DOS-style wildcard (? = any character, * = any number of any characters) you specify is matched by the string. (So practically you only have access to a bool DoesWildcardMatch(string wildcard)...

How to implement a SQL like 'LIKE' operator in java?

I need a comparator in java which has the same semantics as the sql 'like' operator. For example: myComparator.like("digital","%ital%"); myComparator.like("digital","%gi?a%"); myComparator.like("digital","digi%"); should evaluate to true, and myComparator.like("digital","%cam%"); myComparator.like("digital","tal%"); should evaluate...

Scala's existential types

A bit more specific than this question, can someone tell me what is the difference between Scala's existential types and Java's wildcard, prefereably with some illustrative example? In everything I've seen so far, they seem to be pretty equivalent. Edit: A few references. Martin Odersky mentions them; Google's top hit for my question ...

How to handle multiple wildcards with SQL Server

Hello, I have some filters in the following form: Object A +/- Start End ---------------------------------------------- + 000000080000 000000090000 - 000000800500 + 054* Object B +/- Start End ---------------------------------------------- + 000000090000 000000100000 + 00??00900500 - 000000900500 + ...

Inferred wildcard generics in return type

Java can often infer generics based on the arguments (and even on the return type, in contrast to e.g. C#). Case in point: I've got a generic class Pair<T1, T2> which just stores a pair of values and can be used in the following way: Pair<String, String> pair = Pair.of("Hello", "World"); The method of looks just like this: public st...

SQL Select help - removing white space

Hello all, I'm running into a problem when trying to select records from my 2005 MS-SQL database (I'm still very new to SQL, but I learned and use the basic commands from w3schools already). In theory, all my manufacturer records should be unique. At least that is how I intended it to be when I did my first massive data dump into it. Un...

Consecutive wild characters in email

I was looking at email validation. I read in RFC specs that consecutive . (dot) are not allowed, like, [email protected]. But are different wild characters allowed to occur consecutively? Like, [email protected]. And if so, how do I make a regular expression which will take only single occurance of wild characters as long as they a...

Getting wildcards to work in find and replace function in VBA macro for Microsoft Word

Hello all! Thanks in advance for your help! I have a VBA macro for Microsoft Word that I am trying to improve. The purpose of the macro is to bold and italicize all words in a document that match the search terms in the first table of the document. The problem is the search terms include wildcards which are the following: the hy...