Questions tagged [wildcard]

A wildcard character is a specially defined character allowing for substitution of any other character, including a pattern or sequence of characters. Use this tag for questions on how to use wildcards for regular expressions, shell scripting, string manipulation and database control, but not for use in terminal commands as that is off-topic.

A wildcard character is a special character defined by many different systems/programming languages with each their own specific implementations. They may allow for accessing single characters, sets of characters or all characters matching a certain regex pattern.

Examples include :

* - Any sequence of characters. (DOS/Unix)
? - Any single character. (DOS/Unix)
% - Zero or more characters. (SQL)
# - Matches a single numeral. (SQL)
. - Matches a single character. (Regular Expressions)

4611 questions
26
votes
1 answer

Elasticsearch wildcard query string with fuzziness

We have an index of items with which I'm attempting to do fuzzy wildcard on the items name. the query { "from": 0, "size": 10, "query": { "bool": { "must": { "query_string": { "fields": [ "name.suggest" …
dstarh
  • 4,976
  • 5
  • 36
  • 68
25
votes
4 answers

Django ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '*.domain.com'

I've create a Django (1.7) web application with a Nginx, Gunicorn, Django stack and recently I've started to get a number of errors: [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '*.domain.com'. The domain name provided is not valid…
tdsymonds
  • 1,679
  • 1
  • 16
  • 26
25
votes
7 answers

Java Generics: Wildcard capture misunderstanding

Reading the Java online tutorial I haven't understood anything about wildcard capture. For example: import java.util.List; public class WildcardError { void foo(List i) { i.set(0, i.get(0)); } } Why can't the compiler…
user1462183
24
votes
6 answers

Can the "IN" operator use LIKE-wildcards (%) in Oracle?

I have searched this question, and found an answer in MySQL but this is one of those incidents where the statement fails to cross over into Oracle. Can I use wildcards in "IN" MySQL statement? pretty much sums up my question and what I would like to…
Matt
  • 275
  • 1
  • 3
  • 10
24
votes
3 answers

make wildcard subdirectory targets

I have a "lib" directory in my applications main directory, which contains an arbitrary number of subdirectories, each having its own Makefile. I would like to have a single Makefile in the main directory, that calls each subdirectory's Makefile. I…
Zed
  • 57,028
  • 9
  • 76
  • 100
24
votes
4 answers

SQL Like with a subquery

How can i make this work? SELECT * FROM item WHERE item_name LIKE '%' || (SELECT equipment_type FROM equipment_type GROUP BY equipment_type) …
jordan
  • 3,436
  • 11
  • 44
  • 75
23
votes
2 answers

Compare strings in python like the sql "like" (with "%" and "_")

I have a list in python with some strings, and I need to know witch item in the list is like "A1_8301". This "_" means that can be any char. Is there a quick way to do that? If I was using SQL, i just type something like "where x like…
Antonio
  • 482
  • 1
  • 5
  • 16
22
votes
2 answers

Create rule in makefile for just a set of files

I am writing a Makefile, and I want to use a generic rule with wildcards, like %: bkp/% cp $< $@ But I wanted this rule to be valid only for a few specific files. I wanted to define a variable with the list, for example file_list = foo.c bar.c…
dividebyzero
  • 2,190
  • 1
  • 21
  • 33
22
votes
3 answers

Elastic Search wildcard search with spaces

I have the following query. I'm trying to find values of 'hello world', but it returns zero results. However, when value = 'hello*', it does give me that expected result. Any idea how I can change my query to give me that hello world result? I've…
user1530318
  • 25,507
  • 15
  • 37
  • 48
22
votes
5 answers

How do generics of generics work?

While I do understand some of the corner-cases of generics, I'm missing something with the following example. I have the following class 1 public class Test { 2 public static void main(String[] args) { 3 Test t = new…
Jonathan
  • 2,698
  • 24
  • 37
22
votes
1 answer

Proper method for wildcard targets in GNU Make

I am trying to write a Makefile with my source and object files separated and I can't seem to figure out the proper way to accomplish this. I have two methods that work but I'm hoping someone can point the "correct" way to do this is. My project is…
nhmood
  • 245
  • 1
  • 2
  • 5
22
votes
9 answers

Solr wildcard query with whitespace

I have a wildcard query that looks something like: q=location:los a* I'd like it to match "los angeles" and "los altos". A query like: q=los* Works just fine, but as soon as I add whitespace I get no results. How I can use whitespace in my…
tbaz
  • 1,016
  • 2
  • 9
  • 11
21
votes
5 answers

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{ private T item; public…
jassuncao
  • 4,695
  • 3
  • 30
  • 35
21
votes
1 answer

Generics, Type Parameters and Wildcards

I am trying to understand java generics and they seem extremely difficult to understand. For example, this is fine... public class Main { public static void main(String[] args) { List list = null; method(list); } …
Paul Boddington
  • 37,127
  • 10
  • 65
  • 116