wildcard

MySQL - how to use wildcards in WHERE clause for the column names themselves? [closed]

寵の児 提交于 2019-12-13 22:50:29
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I've got a basic question about mysql. In my table 'table' I've got a column named 'foo' (String). And I'd like to do something like this: SELECT * FROM table WHERE %foo% LIKE '%thing%' But it's obviously

msbuild: How can I exclude wildcard paths matching a regex?

纵然是瞬间 提交于 2019-12-13 19:09:05
问题 I want to include all files which match *.c , including in subdirectories, except for any file where its path (beneath the solution root) contains one or more components (directory name or filename) beginning with an underscore. For some reason, this isn't working: <ItemGroup> <ClCompile Condition="!$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', `.*[/\\]_.*`))" Include="../../src/foo/**/*.c"/> </ItemGroup> How can I do this in msbuild? I'm using msbuild 14.0. 回答1: The sytnax

Rails 3.1 - in routes.rb, using the wildcard, match '*' is not catching any routes

爱⌒轻易说出口 提交于 2019-12-13 18:31:06
问题 In my pages_controller.rb file I have a not_found action. I want to have any route that is not matched by an entry in my routes.rb file to go to pages#not_found . Wanting to leverage a wildcard, I made this the last line of my routes.rb file: match '*' => 'pages#not_found' I'm basing this on what I read about wildcards in the ruby guide for routing (http://guides.rubyonrails.org/v3.1.0/routing.html). However it is not working. Instead of going to pages#not_found , I get: AcctionController:

xpath querying when xml format varies

陌路散爱 提交于 2019-12-13 16:29:31
问题 I have a series of variable types like: abc1A, abc1B, abc3B, ... xyz1A, xyz2A, xyz3C, ... data1C, data2A, ... Stored in a variety of xml formats: <area name="DataMap"> <int name="number" nullable="true"> <case var="abc2,abc3,abc5">11</case> <case var="abc4,abc6*">8</case> <case var="data1,xyz7,xyz8">22</case> <case var="data3A,xyz{9},xyz{5A,5B,5C}">24</case> <case var="xyz{6,4A,4B,4C}">20</case> <case var="other01">15</case> </int> </area> I'm hoping to query what an instance like xyz5A, for

Generic return type of non-explicit generic type declared by wildcard

你说的曾经没有我的故事 提交于 2019-12-13 16:27:08
问题 Imagine this piece of code: public static <T> T[] superClassArray(Class<? extends T[]> subClass) { T[] superArray = (T[]) Array.newInstance(subClass.getComponentType().getSuperclass(), 0); return superArray; } The return type T[] of this method would be of whatever type was given as argument subClass , even thought subClass is not garanted to actually represent T[] but just a subclass ( ? extends T ). So the actual return type should be Object since T[] is not declared more explicitly than

Resolve absolute paths with wildcards in Java 6

时光毁灭记忆、已成空白 提交于 2019-12-13 15:40:09
问题 My problem is that I have a number of directories I have to look into programmatically, in Java. These directories all have the same pattern: d:\a\b\c\??_????\d\ I cannot find a way to do this smartly. Any FileFilter (I use WildcardFileFilter) will need a base directory to look into, as they only works with listFiles(), yet in my case there is not base directory as my paths are absolute. I've unsuccessfully tried a few tricks from the Web and then I'm stuck. Your help will be greatly

Optimising LIKE expressions that start with wildcards

北慕城南 提交于 2019-12-13 12:55:35
问题 I have a table in a SQL Server database with an address field (ex. 1 Farnham Road, Guildford, Surrey, GU2XFF) which I want to search with a wildcard before and after the search string. SELECT * FROM Table WHERE Address_Field LIKE '%nham%' I have around 2 million records in this table and I'm finding that queries take anywhere from 5-10s, which isn't ideal. I believe this is because of the preceding wildcard. I think I'm right in saying that any indexes won't be used for seek operations

Allow wildcards to search for subdirectories from a parent directory? [duplicate]

荒凉一梦 提交于 2019-12-13 11:01:27
问题 This question already has answers here : How to search for a subdirectory from a parent directory? [closed] (2 answers) Closed 6 years ago . import java.io.File; import java.io.FileFilter; import java.io.IOException; public class DirectoryContents { public static void main(String[] args) throws IOException { File f = new File("."); FileFilter directoryFilter = new FileFilter() { public boolean accept(File file) { return file.isDirectory(); } }; File[] files = f.listFiles(directoryFilter); for

Using wildcard in table data

不羁岁月 提交于 2019-12-13 09:52:44
问题 Using MYSQL I have a table where the data has wildcards. Example... |ID | Model | |1 | dv209% | I'm tryinh to write a sql query that will find row 1 when model='dv209AWW' or model='dv209asdfs' . Any help would be appreciated. 回答1: use LIKE select id, model from your_table where 'dv209AWW' like model order by id 回答2: Try this: SELECT Id, Model FROM yourTable where model LIKE 'dv209%' So it will find the row when the value is dv209AWW or dv209asdfs 来源: https://stackoverflow.com/questions

How to apply wildcard in instr() in MySQL?

守給你的承諾、 提交于 2019-12-13 07:30:16
问题 Using a wildcard so all records will be matched. My code: if(empty($tag)) { $tag="%"; } mysql_query("select * from mytable where instr(tag,'$tag')>0") or die(mysql_error()); But it returns zero result. Even if if(empty($tag)) { $tag="*"; } It still returns zero result. How to resolve this problem? 回答1: INSTR does not support wildcards. If you want to use wildcards in a MySQL query, you'll have to use a function that supports it, such as LIKE or REGEXP, ie: mysql_query("select * from mytable