FAQ Database Discussion Community


Excel VBA code for multiple vlookup

excel,vba,excel-vba,match,vlookup
For a conduit network, I am trying to find the pipes that drain to a manhole. There can be multiple pipes that can drain to a single manhole. My data-structure are organized in the following way: - Stop Node Label ........ ................ - MH-37 CO-40 - MH-37 CO-40 - MH-39...

Excel compare two columns in different sheets return value from third cell

excel,indexing,match
I have two sheets SHEET A contains more than 1500 entries like this A B C Year Month Births 1880 1 530 1880 2 456 1880 3 234 1890 1 163 1890 2 123 1890 3 125 Sheet 2 is similar but column C has no entries and there are...

Matching first letter of word

regex,perl,match
I want to match the first letter of a word in one string to another with the similar letter. In this example the letter H: 25HB matches to HC I am using the match operator shown below: my ($match) = ( $value =~ m/^d(\w)/ ); to not match the digit,...

Python matching regex multiple times in a row (not the findall way)

python,regex,match
This question is not asking about finding 'a' multiple times in a string etc. What I would like to do is match: [ a-zA-Z0-9]{1,3}\. regexp multiple times, one way of doing this is using | '[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.|[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.|[ a-zA-Z0-9]{1,3}\.[ a-zA-Z0-9]{1,3}\.' so this matches the regexp...

php matching array names to another array's values

php,arrays,order,match
I have some data that is available to me in arrays. I have to display the data in rows and columns, like a table. The first array, $header, looks like this: $header[0]=a, $header[1]=d, $header[2]=b, $header[3]=c, $header[4]=e This array can have any number of elements. The subsequent arrays represent the rows...

INDEX/MATCH, or another function?

excel,excel-formula,match,vlookup,worksheet-function
I have on Sheet1 18 columns: N a list where an Order Number can be selected O a Line number (as the orders have multiple line numbers associated with them) P, Q and R, I want to pull over the data associated with the Order Number and Line number entered....

Regex closest text matching [duplicate]

regex,match,group,closest
This question already has an answer here: Regular expression to stop at first match 4 answers I have string like below. I can't match closest group. I want to extract "text" word. Text Example: some string foo text doo foo doo some string I'm using this pattern. (foo)([\s\S]+)(doo|some) This...

How to use a set of characters in the javascript match method

javascript,regex,match
How can I use all the following characters as a regular expression in the javascript match method and escape the characters that need to be escaped? [email protected]#$%^&*()_-+={}[]|:;<>,./? and space so that mysstring.match(REGEX) returns null only if mysstring does not contain any of the above set of characters "abc".match(REGEX) //should return...

Android Key Hash - Users appearing to have different keys

android,facebook,hash,key,match
We've had our app out on Android for well over a year with facebook integration. I set up the key hash on the Facebook app when the build was first made. We launched a new version of the game 2 days ago, and we have some users with the error:...

Extract variables from pattern matching

vb.net,design-patterns,match,extraction
I'm not a match-pattern expert and I've been working on this for a few hours with no chance :/ I have an input string just like this: Dim text As String = "32 Barcelona {GM C} 2 {*** Some ""cool"" text here}" And I just want to extract 3 things:...

Replace the characters in every line of a file, if it match a condition - Unix

unix,replace,sed,match,condition
I have a file "dummy" in which: If 15 character of the file matches with "R" and 28 character of the file matches with "D" then 53-56 characters should be replaced with 0. I have tried using the below script, but it's not working. for i in `cat dummy` do...

Two Column Lookup

excel,match,vlookup
I have a data set that I want to return an indexed column using two values: a year and a name. Both these values are formatted to general (I also tried text) in my spreadsheet. In one work sheet I have a like of people: On the other, I have...

javascript match method with a closing square bracket character

javascript,regex,match
How can I use a closing square bracket as a character in a javascript regular expression? "Acb[".match('[\(, \), \[]') returns: ["["] But when I add the closing square bracket as a character it does not work : "Acb[".match('[\(, \), \[, \]]') null "Acb]".match('[\(, \), \[, \]]') null ...

Match and replace operation in data frame in R

r,replace,pattern-matching,match,vlookup
Let's say my dataset is like the following: John NA kaira carry John NA maya Sam maya leo paty leo tinker NA tinker fabo leo maya I have another dataset: John 1 carry 2 maya 3 leo 4 tinker 5 fabo 6 sam 7 paty 8 kaira 9 I want...

CSS Target Attribute Containing Partial Match

html,css,match,selector,partial
Using the following CSS, why am I not able to target the 3 following anchor tags? a[href~="checkout"] { /* Do something. */ } <a href="http://shop.mydomain.com/checkout/onepage/"> <a href="https://shop.mydomain.com/checkout/onepage/"> <a href="https://shop.mydomain.com/checkout/onepage/?___SID=S"> What am I doing wrong in my CSS selector? I'm trying to select a partial match using ~= for all URLs...

MySQL: Remove JOIN for Matched Row if 2nd Round of Criteria Not Met

mysql,join,left-join,match
CONDENSED VERSION I'm trying to join a new list with my existing database with no unique identifier -- but I'm trying to figure out a way to do it in one query that's more specific than matching by first name/last name but less specific than by all the fields available...

Lookup in another, dynamically generated, spreadsheet

excel,indexing,excel-formula,match,vlookup
I have a spreadsheet that I need to pull information from another spreadsheet that is automatically generated. The problem with the automatically generated spreadsheet is that the information that I need to pull is not always the same, however the columns that contain the information that I need will always...

Regex for comparison expression

c#,regex,match
I need to match strings like the following: ( anything >= anything ) and there can by only these comparison operators: >= <= == != < > And they can be there only once. What I have is: ^\(.+(>=|<=|>|<|==|!=).+\)$ But it matches stuff like >=!= and so forth. I did...

Match and index all substrings, including overlapping ones

python,regex,indexing,match,overlapping-matches
I'm trying to index the matches using the new regex findall, so that overlapped matches can be considered. However, I could only find the matches, but can't correctly give locations for them. My code: import regex as re seq = "ATCCAAGGAGTTTGCAGAGGTGGCGTTTGCAGCATGAGAT" substring="GTTTGCAG" xx=re.findall(substring,seq,overlapped=True) print xx xx would look like ['GTTTGCAG',...

case insensitive preg replace on special chars/Umlaute

php,preg-replace,match,case-insensitive
This works: echo preg_replace("/TesT/i","<b>FOUND</b>","TEST"); // works as expected prints FOUND Why does this below not work? In my project I want to highlight a search result no matter of the case/writing of the search input echo preg_replace("/üöÄ/i","<b>FOUND</b>","ÜÖÄ"); // does NOT work as expected prints ÜÖÄ I tried the below as...

Conditional VLOOKUP or INDEX MATCH

excel,match,vlookup
I have to lookup values in a table wich is not in order (and can't order it) where I lookup a number which may or may not be repeated, but I need to bring the data of a specific one. The data table is more or less like this: SAP...

jQuery - Using indexOf() with match()

jquery,regex,url,match,indexof
I am currently working on an user script made for YouTube using Firefoxs addon 'Greasemonkey' and came across a deadend.. Is it possible to check the url whether or not the url contains a specific string? I tried using indexOf() along with match() since I want it to check the...

Filter information in two columns

excel,excel-formula,match,worksheet-function,input-filtering
I need a hint is solving Excel task. I have two columns with data (let's say column A contains a list of people I have met in May; column B a list of people I am planning to meet in June). Is there a function in Excel which will compare...

How to get a number from a class name in jquery?

jquery,regex,match
I tried several solutions but the code still doesn't work... Here is what I got so far: $('.next-arrow').click(function (){ var num = $(this).closest('[class^=step-]').match(/\d+/)[0]; console.log(num); }); If I run it without the .match() it works fine and tells me that I'm at "step-1" on console log, but adding .match() doesn't return...

Partial string merge R large dataset

r,merge,match
[Updated below] I'd like to merge a large dataset (112 megs) with a smaller dataset (<1mg) based on common names. The names are inexact matches between both datasets. There are a number of tutorials on stackoverflow for partial matching OR managing large datasets, but not for both. R tends to...

Updating only certain values of data frame based on match

r,match,lapply
I'm trying to update a variable (popsnp) in a higher scope within an lapply, on the basis of a match. I can't quite figure out the syntax for updating the values though, what I have currently overwrites any previously existing values with NA: lapply(1:22, function(i){ in.name<-paste("/data/mdp14aps/ld/chr", i, ".ld", sep="") out.name<-paste("/data/mdp14aps/R/ldatachr",...

Matching two things with string in between

php,regex,match
I have made a syntax of my own and it works fine for things like this: $str = "abc {{for items}} efg"; preg_match('/(?<={{for )[^}]*(?=}})/', $str, $match); // Returns: [0] => items But I want to expand the for command to work like this: $str = "abc {{for item in items}}...

AUTOHOTKEY: RegExMatch() a series of numbers and letters

regex,match,autohotkey
I've tested my regular expression in http://www.regextester.com/ ([0-9]{4,4})([A-Z]{2})([0-9]{1,3}) It's matching perfect with the following strings just as I want it. 1234AB123 2000AZ20 1000XY753 But when I try it in Autohotkey I get 0 result test := RegExMatch("2000SY155","([0-9]{4,4})([A-Z]{2})([0-9]{1,3})") MsgBox %test% testing for: first 4 characters must be a number next 2...

Simple Way of Looking for Key Phrases in Jquery?

jquery,key,match,phrases
I have set up a method of retrieving messages from a real time chat client. I want to take these messages (a lot of text) and find out if any of these messages contain key phrases. If they contain a key phrase I will simply add 1 to a count...

Bash print word after match

regex,bash,sed,match
I have a variable that stores the output of a file. Within that output, I would like to print the first word after Database:. I'm fairly new to regex, but this is what I've tried so far: sed -n -e 's/^.*Database: //p' "$output" When I try this, I am getting...

find matches in two file using python

python,match
I am analyzing sequencing data and I have few candidates genes that I need to find their functions. After editing the available human database , I want to compare my candidate genes with the database and output the function for my candidate gene. I have only basic python skills so...

excel count/sum stop count/sum match?

excel,count,sum,match,sumifs
I have tried to see if this question has been asked before, but I can't seem to find an answer. I have a column of cells (>3000 rows), with either a value of 1 or 0 (call this column A). The value will depend on the value in column B...

Sub-setting / Matching row and columns in R

r,matrix,match,subsetting
Ok, so I need a very specific formula for subsetting. From matrix x, I only want to keep elements defined by rows and columns. The undesired elements should then be replaced by zeros. Example below: > x <- matrix(c(65,46,52,76,34,345,65,87,12,53),nrow = 5,ncol = 2) > x [,1] [,2] [1,] 65 345...

VBA lookup for approximate value

vba,match,condition,criteria,vlookup
I want to perform a special VLookup where the value which is found would match two conditions: The invoice number must be the same The value found from Column G must be within the tolerance -100 to 100 Precisely speaking, if the first value found from Column G (e.g. -18,007)...

Regex: capturing groups within capture groups

regex,substring,match,capture-group
Intro (you can skip to What if... if you get bored with intros) This question is not directed to VBScript particularly (I just used it in this case): I want to find a solution for general regular expressions usage (editors included). This started when I wanted to create an adaptation...

Regular expression, match error

regex,replace,match
i just started with regular expressions and went into trouble by writing one for a case i would need. Here is my problem. I wrote this simple regex: (<img).+[>] it match for the most cases, but not for the case if something is between. Here is a image for you...

'NoneType' object has no attribute 'group' in a list

python,python-2.7,match
I'm trying to put a group of datas in my list thanks to this code but the info_hash have some problems: handshake = piece_request_handshake.findall(hex_data) match = piece_request_handshake.match(hex_data) info_hash = match.group('info_hash') # If the packet is a packet type handshake, if the dest and src ip are not in the list...

Subtract List B from List A, but keeping the List A index and using difflib string similarity

python,string,match,subtract,difflib
I need some help with Python. This is not the classic subtract List B from List A to make List C. Instead I would like to look at the indexes of the items in List A (city names in a single word) that are not in List B, and store...

Perform partial search on MySQL table when exact match may be available

php,mysql,select,match
I am running the following SQL statement from a PHP script: SELECT PHONE, COALESCE(PREFERREDNAME, POPULARNAME) FROM distilled_contacts WHERE PHONE LIKE :phone LIMIT 6 As obvious, the statement returns the first 6 matches against the table in question. The value I'm binding to the :phone variable is goes something like this:...

query for two tables and have one column populate based on first match

sql-server,join,header,match
This is one of those things I am sure has been discussed 1000 times, but all my searches have come just short of me understanding what I need. Two tables: ledger and patient I want to select several columns from ledger, and add one column from patient based on two...

using the 'Match' function in Exel to return a cell address

excel,reference,match,cell,formula
I have a list of numbers in a table that I would like to search for and bring back the cell reference of where that number resides. For example the data looks like: A B C D 1 1 2 3 4 ok it doesn't come out very well as...

Each HTML div Requires item

jquery,match,each
<div><input type="text" name="">{name}</div> <div><input type="radio" name="{demo}" value="{yes}"></div> <div><input type="radio" name="{demo}" value="{no}"></div> $.each($('div'),function(k,v){ var s = $(v).html(); console.log( s.match(/{(.*)}/gi) ); }); I am trying to parse out all of the items wrapped in {curly braces}. I expect to see the following result: ['{name}', '{demo}', '{yes}', '{no}'] But when I run the...

Array Of Objects Help! Compare Student Name with Test Name and assign score

c#,arrays,object,search,match
I've been playing around lately for the sake of learning and wanted to ask for some help on a recent program I was messing with. In this program I have Students and Tests. Each student has a test, and I need to the two to be matched. I thought I...

How do I apply a formula to a range without applying said formula to every cell?

regex,string,google-spreadsheet,match,array-formulas
I'm trying to apply a formula without having it add the formula data to each and every cell - in other words, I need the cells that are receiving the formula to be untouched until they get their data. I was searching around and it looked like an ARRAYFORMULA would...

Match Function in Specific Column Excel VBA

excel,vba,excel-vba,match,worksheet-function
I'm trying to write a program in VBA for Excel 2011 that can search a column (which column that is is determined by another variable) for the number 1 so that it knows where to start an iteration. Say that the number of the column is given by colnumvar. The...

r match filenames in two folders and perform code

r,file,directory,match
I have 2 folders with text files: Aba with 90 files and Baa with 50 files. I have a piece of code where I open files with same names from two folders and perform operation. dna_no= read.table("/home/Documents/Baa/112.txt",skip=1, header=TRUE, sep="\t", fill=FALSE) sim = read.table("/home/Documents/Data/Aba/112.txt",header=FALSE, sep="\t") then I want to perform code...

match subdocument within another subdocument same document

mongodb,match,project,subdocument
I have the following documents in my collection : { "_id": ObjectId('555a33d69487b45401ec1149'), "nombre": "demo", "roles": [ { "id": ObjectId('556ca1999487009c1fac125f'), "nombre": "rol1" }, { "id": ObjectId('556ca1a09487009c1fac1260'), "nombre": "rol2" }, { "id": ObjectId('556ca1a69487009c1fac1261'), "nombre": "rol3" } ], "usuarios": [ { "id": ObjectId('556ca1de9487009c1fac1262'), "activo": true, "roles": [ { "id": ObjectId('556ca1999487009c1fac125f') } ] },...

match lists L1 with L2 in prolog

list,prolog,match
I try to write predicate one_occurence(L1, L2) that is true if each element of L1 occurs once in L2. delete([H|T], H, TN) :- delete(T, H, TN). delete([H|T], E, [H|TN]) :- \+ H = E, delete(T, E, TN). delete([], _, []). /*one_occurence(L,LN) is true if a list LN is identical to...

Making ArrayList Size equal to other Array Lists Available in Java

java,loops,arraylist,match,add
I have 2 ArrayLists of varying sizes. Example - Array1.size() = 10 Array2.size() = 5 I want at all times these arrays to have same size. Thus, I have another class to ensure this. But obviously, it isn't working for me. Please help! Below is that Class code - for...

OpenCV - C++ to Java - Template Match

java,c++,templates,opencv,match
I am trying to detect more than a square (marker) in my image as I ask here Detect Marker Position in 2D image There is one guy that showed me a solution in C++, here it is: #include <iostream> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> //See: http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html //See: http://answers.opencv.org/question/60382/detect-markers-position-in-2d-images/ int main() {...

Cross check files in two folders

vbscript,match,filenames
I have two folders: Master folder & New folder. Files in two folders share the same file name. I need to cross check the files between these two folders. If Master folder does not have the file, I import it from New folder. If Master folder does have the file,...

R: Matching by row and column

r,match,rows
I have two data frames, as below: EquityData ValuationDate Currency Opening Closing 02/01/2003 CHF 0 0 02/01/2003 DKK 0 0 03/01/2003 CHF 0 0 02/01/2003 SEK 0 0 03/01/2003 SEK 0 0 04/01/2003 SEK 0 0 05/01/2003 CHF 0 0 03/01/2003 DKK 0 0 which contains information about trades done...

Javascript match dont include

javascript,regex,match
String: <row>1</row> <row>2</row> Regex: <row>([\s\S]*?)<\/row>/gm Results: ["<row>1</row>", "<row>2</row>"] Desired Results ["1", "2"] ...

How to swap the lines in a file that match a condition using Shell script

unix,match,condition,swap,lines
I have a file in which 28th character of every line is either "A" or "D". I want to swap the lines in such a way that the first line of the file should have the 28th character as "D" and the second line of the file should have 28...

Excel MATCH statement nested in INDIRECT statement?

excel,nested,match
I have these two functions: =INDIRECT("A"& MATCH(A16,Sheet1!A:A,1)) =INDIRECT(J3&"! PUT FUNCTION 1 HERE ") Function 1 returns the value of cell A17, on Sheet 1 Function 2 SHOULD return the value of A17 on Sheet 2 (the second indirect function refers to cell J3, which contains "Sheet2". When I combine the...

Matching a pattern with `match()` with extra condition

r,match,condition
Expanding on a previous question (R: gsub of exact full string with fixed = T). [With huge thanks to everyone who helped there. Special thanks to @MrFlick] I need to change "32 oz" to "32 ct" but only if extra condition "3" is met, not in any other case. exact_orig...

How to return all opposite pairs in a Pandas DataFrame?

python,pandas,match,dataframes
For the dataframe below, how to return all opposite pairs? import pandas as pd df1 = pd.DataFrame([1,2,-2,2,-1,-1,1,1], columns=['a']) a 0 1 1 2 2 -2 3 2 4 -1 5 -1 6 1 7 1 The output should be as below: (1) sum of all rows is 0 (2) as...

INDEX MATCH multiple criteria not working (#N/A)

excel,indexing,match,lookup
I am attempting to match 2 criteria (drug generic and drug pack size) in an INDEX MATCH formula to cross-reference 2 databases I have. Despite reading several posts on this and other sites I just cannot get these to work. Working in Office 2010. Formula 1 attempt (referencing 3rd column...

Regular expression in JavaScript to match turkish characters

javascript,regex,match
I am using this code: var icerik = $(this).val(); var kelime = /#(\w+)/ig; var isim = icerik.match(kelime); I am doing ajax process, example: #bursa is working, but #büşra isn't working, It isn't posting after the b. https://jsfiddle.net/6mo9cyv5/ What can I do?...

What could this expression in Excel mean

regex,excel,indexing,match,vlookup
Using INDEX and MATCH for lookups and came across an expression someone used in the form of : =INDEX(*range used*, MATCH(MIN(ABS(data!E2- lookup!$L$5:$L$105)),ABS(data!E2-lookup!$L$5:$L$105),0)) lookup!$L$5:$L$105 is the value lookup table range. I know what its suppose to do but the "data!E2-lookup!$L$5:$L$105" part does not make sense. How does this work? Thanks...

Matching a file with table in postgres and identify the match level

java,postgresql,arraylist,match,multicolumn
I have a table with 4 columns and is loaded with data. The data can range from 1000 to maximum of 2Million. I get a file (lets say tab separated) as part of daily process with the data for 4 columns. I should prepare a report where for each column...

Java Regex for HTML status code when checking entire multiline HTML header

java,regex,match,multiline
I want to verify HTTP response status code - the syntax is HTML/1.1 200 ... The string passed is multiline, containing line breaks. My preliminary regex is ^(HTTP|http)/(1|2)\\.\\d \\d{3}.+$. Works well when I pass only one line, without line breaks and the rest rows. What is wrong with this regex?...

Why is match returning the whole string as the first element in the array?

javascript,regex,match
Let's say I have this string: '1234*321*123' And I want to get each group of digits as an element in an array. So I used this: '1234*321*123'.match(/^(\d{4})\*(\d{3})\*(\d{3})$/); But that's returning ["1234*321*123", "1234", "321", "123"], when I was expecting ["1234", "321", "123"]. Why, if only the digit groups are enclosed within...

Ruby Regex Replace Last Occurence of Grouping

ruby,regex,match,gsub
In Ruby regular expressions I would like to use gsub to replace a last occurrence of a grouping, if it occurs, otherwise, perform a replacement anyways at a default location. I am trying to replace the last occurrence of a number in the 40s (40...49). I have the following regular...

Javascript Regex matching multiple repeating blocks

javascript,regex,pattern-matching,match
I need to match a series of repeating VirtualHost configs in Javascript, Example: ... # First VHost... <VirtualHost *:80 *:8082> # Any number of configs # and set up options for # Apache </VirtualHost> # Second VHost... <VirtualHost *:80 *:8082> # Any number of configs # and set up options...

Lua word search

arrays,lua,match,word,lpeg
How would I go about doing a multiple pattern search in Lua? (I have Lpeg set up). For example, say I'm receiving strings in a row, I'm processing one at a time, captalizing them and calling them msg. Now I want to get msg and check if it has any...

Finding closest value if date is equal to a certain date

excel,if-statement,indexing,excel-formula,match
I want a formula that finds the moneyness closest to 100 for a certain date. I made this formula: =(IF("02-01-2009"=C2:C131104;INDEX($K$2:$K$131104;MATCH(MIN(ABS(K2:K131104-100));ABS(K2:K131104-100);0));"")) But it searches the entire sheet instead of only the rows where the date is 02-01-2009. The data...

Compare two files and append the values, leave the mismatches as such in the output file

awk,compare,match,mismatch
I'm trying to match two files,file1.txt(50,000 lines), file2.txt(55,000 lines). I want to campare file2 to file 1 extract the values of column 2 and 3 and leave the mismatches as such. Output file must contain all the ids from file2 i.e., it should have 55000 lines. Note: All the ids...

Index & Match formula does not show the repeated entry with different value

excel,indexing,excel-formula,match
I have an excel spreadsheet - downloadable here contains some columns as following : Column A : Companies' Names Column B : Project's Name and so on, now when i try to filter my data using combo box to show only companies in specific area and use INDEX and MATCH...

Inconsistent match function, if I run twice works (R)

r,match,matching
I am trying to reorder a numeric vector current_qty using its name according to another vector trade_order. After a simple match, they give me some weird arrangement. current_qty <- getQuantity(trades) print(names(current_qty)) [1] "ivvb11" "lft20210301" "ltn20180101" "ntnb20200815" "pibb11" print(trade_order) [1] "pibb11" "ivvb11" "lft20210301" "ntnb20200815" "ltn20180101" current_qty <- current_qty[match(names(current_qty), trade_order)] print(current_qty) lft20210301...

Issue with Arrays/Match/Index

arrays,excel,if-statement,excel-formula,match
Here is my current formula I use to pull the latest live date for a customer out of a web query. {=LARGE( IF(Table_owssvr_1[HQ Name]=B1,1,0)* IF(ISNUMBER(Table_owssvr_1[Live Date]),Table_owssvr_1[Live Date],0), 1)} B1 is the name of the customer. HQ name is column A and contains customer names. This formula will give me the...

How to match a word using a given character only once

c#,regex,match
I'm trying to find a regex pattern to match a word with some given characters. But each character should be used only once. For example if I'm given "yrarbil" (library backwards), it should match these: library rar lib rarlib But it should not match the following libraryy ("y" is used...

MySql search name and email in multiple column

php,mysql,match
I am facing a problem matching/ searching values in multiple column in mysql. In my table i have name, owner, email, altemail, altemail2, altemail3 column name. name = John; email = [email protected] now name might be in name or owner column and email might be in above four column. now...

Replace string dynamically

php,regex,string,match
How can I remove this string: class="size-full wp-image-1561 " from this string: class="size-full wp-image-1561 " alt="Class-A warehouse facility developed by Panattoni Europe in Germany for Rudolph Logistik Gruppe." src="http://europe-re.com/wp-content/uploads/2012/12/Class-A-warehouse-facility-developed-by-Panattoni-Europe-in-Germany-for-Rudolph-Logistik-Gruppe.jpg" Consider that the class changes every record. How can I do it dynamically? Something like "remove class="(whatever is inside here)" from...

Google Sheets - Array Formula, match, lookup

indexing,google-spreadsheet,match,lookup,array-formulas
I Just cant mange this - Help Im trying to do something but just cant manage it. If you look at the image below you will see Username, Sponsor, Referral 1, Referral 2. IMAGE of spreadsheet - http://imgur.com/60Omdp7 Now what i want to do with a formula is E&F or...

Perl: matching data in two files

perl,match
I would like to match and print data from two files (File1.txt and File2.txt). Currently, I'm trying to match the first letter of the second column in File1 to the first letter of the third column in File2.txt. File1.txt 1 H 35 1 C 22 1 H 20 File2.txt A...

Regex match defined length number broken up by spaces/hyphens

regex,match
I would like to match all alphanumeric strings [a-zA-Z0-9]+ with length of {4,34}, however they may be randomly broken up by spaces or hyphens. The length is the quantity of alphanumeric digits, not hyphens or spaces. For example, AA99-A3-2134-22-5 would fit this expression, as the quantity of alphanumeric characters is...

Use Python/Pandas to Match Sample Pairs Yearly Data

python,pandas,match,time-series,multi-index
While this may start out sounding like as statistics question, please bear with me. I have several calcium concentrations from water samples collected at different sampling locations. The water is resampled at some of the stations on a monthly, yearly, every other year basis. I want to measure yearly and...

subset data from matching package

r,match,subset,dplyr
So following the example from the Matching package and in particular the GenMatch example Link to package description pp11. We have the following code library(Matching) data(lalonde) attach(lalonde) lalonde$ID <- 1:length(lalonde$age) X = cbind(age, educ, black, hisp, married, nodegr, u74, u75, re75, re74) BalanceMat <- cbind(age, educ, black, hisp, married, nodegr,...

Regex from a html parsing, how do I grab a specific string?

c#,html,regex,match
I'm trying to specifically get the string after charactername= and before " >. How would I use regex to allow me to catch only the player name? This is what I have so far, and it's not working. Not working as it doesn't actually print anything. On the client.DownloadString it...

Matching vector of default values using match.arg() with or without error [R]

r,function,arguments,match,evaluation
I want to write a function that applies one of two different statistical methods to its input. In the process, I noticed some behavior of different functions that I do not understand. The function I want to write should have the following properties: it should have a vector as a...

Matches in a string in Java

java,string,variables,match
I have this code: String string = "40' & 40' HC"; if(string.matches("&")) System.out.println("Found"); But the condition won't be true. why? Help is appreciated. Thanks...

How can I match or lookup a value on Excel?

excel,match,lookup
I got these 2 questions in an exam, and as easy as they sound, I couldn't get them right. So I have this table. And the questions are: 1- Using a function, What is the price of the first Diesel car that appears on the list? 2- Using a function,...

Excel Logical Function to Concatinate

excel,function,search,find,match
I'm trying to concatenate values based on the value of a cell, however, this requires a logical function. I've tried it with both FIND, MATCH and SEARCH, but it's not outputting the expected results. How do I get it to work expectedly? Suppose the expected result must be an email...

IF duplicate cell value found in column then return value

excel,if-statement,indexing,match,countif
I need to track a person in a data sheet to determine from which location to which location the person moved. If a person appears more then one time in Column J that means the person has changed the location and the location value is in Column L. For this...

how to check in javascript if is string in 100 000,00 format

javascript,string,numbers,format,match
let's say I have a string contained numbers, and I need to check if it's in specific format where would be every thousand separated by a space, followed by "," and 2 digits with decimals. So for example, 20125,33 would be like 20 125,33 122000111,15 would be like 122 000...

Perl : How to match data in entire text

perl,csv,match,multiple-columns,variant
In the following code I am trying to use data from Input File 1 to edit data in Input File 2. But the problem is the code is not able to match or substitute when the possible match text is anywhere other than at the last, towards right. Could you...

can match() have a range included in R?

r,match
I am trying to use match() in R to find any matching values within a certain interval. For example: v <- c(2.2, 2.4, 4.3, 1.3, 4.5, 6.8, 0.9) match(2.4, v) gives me all the locations where 2.4 occurs in v, but what if I wanted to give a range for...

Regex with lookahead and lookbehind

php,regex,match
I have the following regexp that works great. $str = "ID: {{item:id}} & First name: {{item:first_name}} & Page Title: {{page:title}}"; preg_match_all('/(?<={{)[^}]*(?=}})/', $str, $matches); print_r($matches); Returns: Array ( [0] => Array ( [0] => item:id [1] => item:first_name [2] => page:title ) ) How do I need to modify the regex...

Use string in match [duplicate]

javascript,regex,match
This question already has an answer here: How do you pass a variable to a Regular Expression JavaScript? 15 answers Hello i have a script where i have an textarea with the meta description and i have a input text field where i put the keyword. Then i print...

Python wild card match

python,match,wildcard
I have a file like this iPhone6-16GB-Black,40000,10000,10000,20000 iPhone6-16GB-White,40000,10000,10000,20000 iPhone6-16GB-Gold,40000,10000,10000,20000 iPhone6-16GB-Silver,40000,10000,10000,20000 iPhone6-16GB-Gray,40000,10000,10000,20000 iPhone6-64GB-Black,40000,10000,10000,20000 iPhone6-64GB-White,40000,10000,10000,20000 I need to search line by line and find all the lines that match the input if input = iPhone6-*-* It should match all lines with iPhone6- if input = iPhone6-16GB-* It should match all lines with...

Strange behavior of match function in R

r,match
I'm trying to find out why the match function is showing strange behavior when comparing two numeric vectors. It obviously has something to do with the precision of the values, but I have been unable to find a good description of the issue. I have been able to solve the...

How to check if a regex groups are equal?

c#,.net,regex,match
I have a RegEx that checks my string. In my string I have two groups ?<key> and ?<value>. So here is my sample string: string input = "key=value&key=value1&key=value2"; I use MatchCollections and when I try to print my groups on the console that here is my code: string input =...

Check if location is within a certain distance of a set of other locations using R

r,match,geospatial,distance,latitude-longitude
I've been trying to solve this problem for a while now, but I can't seem to wrap my head around it. I am still new to R and a first time poster here. I tried to follow the rules as much as possible, but please let me know if I...

Unix Pattern Matching

unix,character,match
So I need to do this pattern match and I need to list all files in a folder that have the characters "file" and one more character afterwards. so I need to type ls -1 "file" but im missing what it takes to find all files that have one more...

Why python regex match function matches that special character? [closed]

python,regex,match,special-characters
I have regex pattern "^[a-zA-z0-9]+$" As I understand it should describe a word or something like that. I try to verify a string like "counter": re.match("^[a-zA-z0-9]+$", "counter") # Result: <_sre.SRE_Match object at 0x000000AA2053C578> # If I have special character like "/" it won't match (returns nothing). re.match("^[a-zA-z0-9]+$"), "coun/ter") But if...

How to select elements from previous div that have the same position inside parent

javascript,jquery,html,css,match
<ul class="user-text"> <li class="user-text">User 1 Text</li> <li class="user-text" style="display:none">User 2 text</li> <li class="user-text" style="display:none">User 3 text</li> <li class="user-text" style="display:none">User 4 text</li> </ul> <ul class="user"> <li class="user">User 1 image</li> <li class="user">user 2 image</li> <li class="user">user 3 image</li> <li class="user">user 4 image</li> </ul> I think...

Using JS .match() to extract number from string, then use the result to test equality

javascript,regex,match
Hope someone can help as I quite new to JS. I need to extract a number from 2 strings then test the result for equality against each other. For example var test1 = "7D" var test2 = "7H" To extract the numbers I'm using the following code, test1.match(/\d+/) = result...

neo4j cypher count relations between same type of nodes

count,neo4j,match,cypher
I am too new in graph databases and I have a problem in getting data from model like this. I am trying to count common likes between User1 and all other users in same group as user1. Here is the result I am trying to get for User1: User ,...

Cypher - atomic insert if node is absent

neo4j,match,case,cypher
I would like to write a single Cypher statement that tests for the existence of a path, adding it if the part is not present. Consider path (:A)-[:REL]->(:B{id:123}), then the existence of the path can be tested by OPTIONAL MATCH p = (:A)-[:REL]->(:B{id:123}) RETURN CASE COUNT(p) WHEN 0 THEN false...