match

Find links to images in HTML (incl. outside of common tags/attributes)

I'd like to find (using javascript) all of the references to image links on an HTML page. Since I'm also looking for image references that may not be displayed, or are in unknown attribute types, simply looking for image tags or src's etc. isn't enough. As such, I haven't yet found a simple method using an html parser to do this. Ha...

hashtag boundaries matching regex in javascript

I'm trying to match a set of hashtags or words in a javascript string. (#hashtag|word) almost does it, except I'd like to consider word boundaries. \b(#hashtag|word)\b doesn't match the beginning word boundary, since of course '#' is not a word character. ideally i'd like to have something like a '\b' anchor that matches hashtags...

Java regex: Get the matched sequence

In Perl/PHP regex is's possible to match a sequence and get an array with matched sequences: preg_match('/20[0-1][0-9]/', $inputstring, $array_return); // PHP I can't figure out how to do this in Java. match.group() returns the whole string. Is this impossible? ...

JavaScript - Use variable in string match

Hello, i found several similar questions, but it did not help me... so i have this problem: var xxx = "victoria"; var yyy = "i"; alert(xxx.match(yyy/g).length); I dont know how to pass variable in match command. Please help. Thank you. ...

Enable whitespace in php regular expresssion

I want to have A-Z, 0-9 and whitespace ignored in regular expression, currently I have this, it works but whitespaces are ignored too but I need them. preg_match_all("/[^\w]/",$string,$matches); ...

extracting text from HTML (Perl)

I'm doing a script that enters a page and extract and extract information from it. The script I'm doing it in Perl. Problem: Not how to start running the script because when I start it picks up the url like this and this is not what I want <a href="http://valeptr.com/scripts/runner.php?BA=6672&amp;amp;hash=08c5c66839a468a11b7574e6ce02e...

Using an overall WHERE clause when using UNIONS in sql

Hi, I am trying to return the MATCH() AGAINST() results against several tables using UNIONS, the only problem is some rows return a relevance of 0, I want to exclude these. After the unions is there a way to use 'WHERE relevance > 0' Below is a bit of my SQL SELECT pages.content AS search, page_info.url AS link, MATCH(pages.content) AG...

Need help understanding Javascript's .match method

Hello all, I understand that .match() returns an array of the matches, or null if none are found. But how do I go about accessing the values of capturing groups used with .match? For example: var val = whatever.match('(?:^|;) ?' + stuff + '=([^;]*)(?:;|$)'); Assuming the regular expression matches more than once, how do I access th...

Python : match string inside double quotes and bracket

Hello,I want to match text inside double quotes and bracket as two groups by use regex, How can I do that? from “作為”(act) ,用於罪行或民事過失時,包括一連串作為、任何違法的不作為和一連串違法的不作為; “行政上訴委員會”(Administrative Appeals Board) 指根據《行政上訴委員會條例》(第442章)設立的行政上訴委員會;(由1994年第6號第32條增補) “成人”、“成年人”(adult)* 指年滿18歲的人; (由1990年第32號第6條修訂) “飛機”、“航空器”(aircraft) 指任何可憑空氣的反作用而在大氣中獲...

Php Match words code not working on php 5.1.6

Hello, i have piece of code that works fine on my local test server but on live server for some reason it does not. Php version on live server is 5.1.6. $subject = 'random words to check'; $terms = explode(' ', 'word1 word2 check'); $wordIndex = array_flip(preg_split('/\P{L}+/u', mb_strtolower($subject), -1, PREG_SPLIT_NO_EMPTY)); fo...

Mysql MATCH AGAINST - IN BOOLEAN MODE problem

I need to find the following string: 'c++' My sql query look like this: SELECT * FROM shop_product WHERE MATCH(shop_product.name, shop_product.product_model, shop_product.keywords, shop_product.part_number, shop_product.upc, shop_product.brand_name) AGAINST ('c++' IN BOOLEAN MODE)) GROUP BY `product_id` LIMIT 0, 25 This script ...

How to do weighted MySQL match search

Hi guys, so we can use mysql to search for full text indexed fields via the MATCH keyword... my question is...is there a native way to do this in which certain column's index is given greater weight than the other So for instance if I search using the indexes title, keywords, and description...is there a way to make entries in title a...

OpenCV Template Matching

I am preparing a sample by using OpenCV cvMatchTemplate(); function and I want to find all templates that's max. loc. upper than 0.40 with CV_TM_CCOEFF_NORMED method. I mean I want to find all templates which match. I find only the best match template but I want to find all of them. I hope I explained what I want. Thanks. ...

MySQL Match Against query does not work with Urlencoded string

This is the table. CREATE TABLE `posts` ( `post_id` int(20) NOT NULL AUTO_INCREMENT, `post_archived` enum('Y','N') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'N', `post_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `post_author` int(20) NOT NULL DEFAULT '0', `post_date` timestamp NOT NULL D...

MySQL MATCH doesn't work with two characters?

Hi, I have a table called 'business' with the following sample data: Street - 150 N Michigan Ave. City - Chicago State - IL Zip - 60601 When I run a query like SELECT business.* WHERE MATCH(business.Street, business.City, business.State, business.Zip) AGAINST('*150*' IN BOOLEAN MODE) -- IT WORKS SELECT busines...

Register(/bind/match) a device with a driver

Hello, I am writing a usb driver (for a gamepad) on linux, and when I plug it in, ti loads usbhid. How can I make it so it loads my driver (gp_driver)? I did the unbind usbhid and bind to my driver trick, but I don't want to do it every single time. Should I have my driver already loaded? Should I code something in my driver? I have the...

MySQL MATCH AGAINST query with long WHERE AND OR syntax?

The following query is not working the way I expect: SELECT DISTINCT * FROM mytable WHERE MATCH (StrNum, StrName, StrType, TownName, Zip) AGAINST ('elm') AND Color = 'RED' OR Color = 'WHITE' OR Color = 'BLUE' This is returning more results than I expect - it's not limiting my results to those on 'elm'. If I remove the last line (A...

How to match the numeric value in a regular expression?

Okay, this is quite an interesting challenge I have got myself into. My RegEx takes as input lines like the following: 147.63.23.156/159 94.182.23.55/56 134.56.33.11/12 I need it to output a regular expression that matches the range represented. Let me explain. For example, if the RegEx receives 147.63.23.156/159, then it needs to ...

Regex match 1024KB convert to 1MB?

I get the file size from the index of the page, it's 1024KB and I want it to print 1MB stead of 1024KB, what should I do? (completely noob here) I got this: if($row[2]==1) // Rapidshare Check { $index=getpage($row[1]); if(strpos($index,"FILE DOWNLOAD")===false) //check if page contains the word file download if not = bad link {...

Regex Group in Perl: how to capture elements into array from regex group that matches unknown number of/multiple/variable occurrences from a string?

In Perl, how can I use one regex grouping to capture more than one occurrence that matches it, into several array elements? For example, for a string: var1=100 var2=90 var5=hello var3="a, b, c" var7=test var3=hello to process this with code: $string = "var1=100 var2=90 var5=hello var3=\"a, b, c\" var7=test var3=hello"; my @ar...