Questions tagged [match]

A programming concept about finding results based on some kind of search. Typically used when talking about regular expressions.

A programming concept about finding results based on some kind of search. Typically used when talking about regular expressions.

See also , ,

8645 questions
2
votes
3 answers

Regex match between two arrays of strings

I have two arrays sentences_ary = ['This is foo', 'bob is cool'] words_ary = ['foo', 'lol', 'something'] I want to check if any element from sentences_ary matched any word from words_ary. I'm able to check for one work, but could not do it with…
Ashwin Yaprala
  • 2,737
  • 2
  • 24
  • 56
2
votes
3 answers

Find and get the location of a list of words in a text

I'm sure this is simple but I just can't figure out what to do... I have a text file with a bunch of words in it (let's call it "wordlist") organized in a single column. Then I have a big text file (let's call it "essay"). What I want to do is to…
chris202
  • 191
  • 1
  • 9
2
votes
1 answer

perl match whole word only with array list

I need to be able to match a user to a list of users, but only an exact match. In the sample code below: - if strUser contains "info" there is a match and that's good. - if strUser contains "theinfo", or "infostuff" there is a match and that's not…
Xi Vix
  • 1,381
  • 6
  • 24
  • 43
2
votes
3 answers

using a lookup table in R with varying counts of data

Hiiii, I've been working on this issue all weekend. I'm trying to do a simple lookup, but my lookup table has different counts of data per lookup key. Let's say I have two tables: Table1: (there are some extra columns of data, but irrelevant to…
David
  • 182
  • 2
  • 9
2
votes
3 answers

Regex to get all lines past last detected string

I have this text: Blah Blah Blah Blah //// CODE --- do not change Blah Blah Blah Blah Blah //// CODE --- do not change Blah I Want This Text Matched I want to match just this part of it (all lines after the last //// CODE ---…
Alexandru
  • 12,264
  • 17
  • 113
  • 208
2
votes
2 answers

Why does string.match(...)[0] throws an exception?

I'm trying to pull the first occurence of a regex pattern from a string all in one statement to make my code look cleaner. This is what I want to do: var matchedString = somestring.match(/some regex/g)[0]; I would expect this to be legal but it…
NathanielB
  • 145
  • 1
  • 1
  • 10
2
votes
1 answer

How to get the exact matched keyword in MySQL MATCH() AGAINST() search?

I am performing a search in mysql using MATCH() and AGAINST() function with multiple keyword. How to know which keyword matched for the search. SELECT ... , MATCH(n.s_body_from_rss, n.s_full_body) AGAINST("LIST OF KEYWORDS' IN BOOLEAN MODE") AS…
Banty Roy
  • 914
  • 6
  • 23
2
votes
5 answers

Find same text and add class to container with jQuery

I’m trying to find if any of h2 texts matches with h1 text. Plus not being case sensitive. If finds a match, then add class for the container Product-div.
Aleksi
  • 115
  • 1
  • 15
2
votes
1 answer

TypeError: expected string or buffer with re.match and matchObj.group()

I keep getting the error: Traceback (most recent call last): File "ba.py", line 13, in matchObj = re.match(r"^(\w+ \w+) batted (\d+) times with (\d+) hits and (\d+) runs", line) File…
Virge Assault
  • 1,356
  • 6
  • 18
  • 40
2
votes
1 answer

regex capture multi character delimiter

I'm trying to learn regex, but still have no clue. I have this line of code, which successfully seperates the placeholder 'FirstWord' by the '{' delimiter from all following text: var regexp = new…
betaFlux
  • 183
  • 1
  • 3
  • 12
2
votes
1 answer

match() textarea value then append words to a div mantaining their original order

I'm trying to do a regex match into a textarea value to extract words, then append them to another div mantaining the original order.. but the order is not respected.. If I have this in my…
user3542686
2
votes
2 answers

Setting up static routes in Rails

Need some Rails help (using rails 4.0.8 and ruby 2.0.0)... I'm trying to refactor my routes, so instead of having... App::Application.routes.draw.do get "static_pages/home" get "static_pages/help" get "static_pages/about" get…
Ponchooo
  • 83
  • 1
  • 9
2
votes
4 answers

JS/Jquery, Match not finding the PNG = match('/gif|jpg|jpeg|png/')

I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){ var elem = $(this); // Convert everything to lower case to match smart …
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
2
votes
2 answers

Find the same word in two different strings

I would like to find same word in two string. startpoint = newresult.indexOf('\''); endpoint = newresult.lastIndexOf('\''); variables = newresult.substring(startpoint, endpoint); variables = variables.replace("\r\n", ","); variables =…
nic
  • 125
  • 1
  • 3
  • 7
2
votes
1 answer

Laravel Regex Match Url with JPG not working

I at http://www.regexr.com/ match a regex that needed for laravel 's regex validation. validate the url end with jpg/gif/png file. /(http|https):\/\/(www\.)?[\w-_\.]+\.[a-zA-Z]+\/((([\w-_\/]+)\/)?[\w-_\.]+\.(png$|gif$|jpe?g$))/ig But when i put my…
Mavichow
  • 1,213
  • 17
  • 41
1 2 3
99
100