Questions tagged [match]

1

votes
1

answer
425

Views

replacing multiple matches in preg_replace_callback

I have a string which reads foo_bar_one, what I am trying to achieve is foo_Bar_One, using this regex /(?
Rehan
1

votes
0

answer
58

Views

Why wildcard character “*.*” can match a file without extension

There is a file 'a' in a directory. When I search by '.', I get 'a'. But the file 'a' doesn't have a extension and there is no dot in 'a'. Why?
Jerry Chou
0

votes
0

answer
5

Views

How to Get Single Value From Many Data With Preg_match_all

i have some data regarding my school i want to make a list of particular age students and teachers i have a example like this here is our data :- [{'groupnumber':1,'groupid':1737983,'users':[{'id':2949,'user_name':'vishal kumaar','role':'classmate','bonus':'9','image':'www.example.com/myusers-8601.p...
rinkesh1992
1

votes
4

answer
149

Views

preg_match to extract data from string

I have a string 'CPC >= $0 (Yesterday)' and I want to get data: CPC, >=, 0, Yesterday. However the sign >= can vary between few more signs but is always comparison sign. $str = 'CPC >= $0 (Yesterday)'; preg_match('/(?\w+) (?\w+) $(?\d+) \(((?\w+))\)/', $str, $matches); print_r($matches); This gives...
1

votes
2

answer
358

Views

Matching rows based on column value python pandas

I am working with financial data and I want to match timestamps of two stocks. The format I have (or can generate) is: A big dataframe with columns [timestamp1, ..., timestamp2, ....] or two seperate dataframe with columns [timestamp1, ..] [timestamp2, ...] with index type integer. I want to get a b...
Dennis
1

votes
1

answer
45

Views

Modify preg_replace to add span to both first letter and first word

I am using the following preg_replace code to add a -Tag around the first letter of a paragraph (in Wordpress):
nazim
1

votes
0

answer
73

Views

OSRM match service for public transportation

I'm a newbie to routing engines and my first attempts are done with OSRM. I want to use the match service (i.e. given a GPS dataset, I want the service to match those points to the road network in the most pausible way). Questions I have is : 1) is it possible with match service to specify public t...
Patrick
1

votes
0

answer
63

Views

Python3 opencv get number of template matchs

The idea is to read a stream from an IP CAM who receive a 640*480 video and make a matrix about it, like a 1 if a point is in the rectangle or a 0 if not. I'm blocked because when I get the values of the X & Y it's only take random point and not all the datas in a list for example. I want to get the...
Unicone
1

votes
2

answer
56

Views

javascript how match whole words but in certain length limit

for example i have this two strings: string1: 'hi sir may name is Jone' string2 'hi may name is Jone' i have this this regex: var regex = XRegExp('hi(?:(?!hi|Jone).)*?Jone', 'gs'); will match both of them but i want to modify the regex to match only in limited length of the whole string i want to m...
jsem
1

votes
0

answer
251

Views

WP All Import and custom field which has relationship

I'm working with WP All Import plugin to import several new records to my custom post created with Pods - Custom Content Types and Fields plugin. I can easily import fields that have no relationships, but with the 1 field which has relationship I have troubles. I have excel file(which I want to impo...
Andrii Pryimak
1

votes
0

answer
37

Views

VBA Index MAtch Error 1004

Can you help me understand and resolve what's wrong with the following code? Sometimes, it does work but then after one or two test, I get this 1004 error message 'Unable to get the Match property of the WorksheetFunction class'. It is a vba in a form to search the value of the textbox1 (which is a...
Brenda Attale
1

votes
2

answer
209

Views

Redshift create all the combinations of any length for the values in one column

How can we create all the combinations of any length for the values in one column and return the distinct count of another column for that combination? Table: +------+--------+ | Type | Name | +------+--------+ | A | Tom | | A | Ben | | B | Ben | | B | Justin | | C | Ben...
bliu
1

votes
1

answer
56

Views

Match dates from list of data frames in R

I have a list of 100+ time series dataframes my.list with daily observations for each product in its own data frame. Some values are NA without any record of the date. I would like to update each data frame in this list to show the date and NA if it does not have a record on this date. Dates: start...
STACKin
1

votes
1

answer
50

Views

Merge two data frames by matching levels of factor- matching factor levels added as columns

I have two df. They differ in the number of rows but have a common column lepsp. set.seed(571) year = as.factor(c(rep('1998', 20), rep('1999', 16))) lepsp = c(letters[1:20], c('a','b','c'),letters[8:20]) freq = rpois(36, lambda=12) df1
Danielle
1

votes
0

answer
49

Views

php “preg_match” function syntax to select images ordered in slideshow by number

I need to verify the proper syntax after the 'preg_match' function that will select slide images that are ordered in a slideshow initially by number. The following is the code in my 'php' file the selects the files to be fed to javascript/jquery for the slideshow. $photovar=$_GET['id']; if (!preg...
Jim Ridge
1

votes
1

answer
28

Views

preg_match_all reading from file returns empty array

I'm trying to read a file and filter its content. The result I'm expecting is this: https://regex101.com/r/uMTrtd/3 but I don't know why I'm not getting it. I've tried changing the PCRE limits with no result and I don't know what else to do. If I run the preg with the actual string instead of readin...
Nstemp
1

votes
0

answer
58

Views

regex - RxJS 6 migration pipe

I want to create a regex that match the .map function of RxJS and transforms it into a pipe. For now I have this regex : /.map(([^)]+))/g That will match : Regex result But It doesn't work when I have a map inside a map with : .pipe(map($1)) Output : Output with pipe I need to know if the .map is c...
Kansa
1

votes
2

answer
41

Views

Python 3 find specific metacharacters or letters in user input

I am trying to make a folder creator script which works great, however when you type in ':' for example without quotes as the folder name it does some strange things. I wrote the code below to try to handle any characters such as those when someone tries to name a folder with them. Code below seems...
Travy641
1

votes
3

answer
93

Views

Where does the case insensitive modifier go in this regular expression

In the regular expression below, where does the i modifier go so as to make the search terms $searchfor case insensitive? It seems it won't work no matter where I place it. $file = 'xml.xml'; $searchfor = '(||)'; header('Content-Type: text/plain'); $contents = file_get_contents($file); $regExp = '/^...
Norman
1

votes
1

answer
33

Views

IF with INDEX & MATCH

I need to tell my formula to search for one specific value in two different tabs. I currently wrote this (and it's working): =INDEX(' table (2)'!I2:S727,MATCH('TEST'!P3&'TEST'!Q3,'table (2)'!G2:G727&'table (2)'!H2:H727,0),MATCH('TEST'!R3,'table (2)'!I1:S1,0)) I have two conditions: BLUE and RED. The...
Pascal
1

votes
2

answer
62

Views

Validate url parameters with preg_match

Valid example 12[red,green],13[xs,xl,xxl,some other text with chars like [email protected]#%] number[anythingBut ()[]{},anythingBut ()[]{}](,number[anythingBut ()[]{},anythingBut ()[]{}]) or nothing Full match 12[red,green] Group 1 12 Group 2 red,green Full match 13[xs,xl,xxl,some other text with chars like [email protected]
Alex Tofan
1

votes
1

answer
25

Views

Match fails elasticsearch

I have the following index in which I index mail addresses. PUT _myindex { 'settings' : { 'analysis' : { 'filter' : { 'email' : { 'type' : 'pattern_capture', 'preserve_original' : true, 'patterns' : [ '^(.*?)@', '(\\w+(?=.*@))'] } }, 'analyzer' : { 'email' : { 'tokenizer' : 'uax_url_email', 'filter...
Denisa Corbu
1

votes
1

answer
73

Views

How preg_match return 1

It is not possible to create a regular expression of this type xx.xx.xxx, where x - can be any Latin or Russian character of any register or digit. But there must be 2 symbols, then the dot => 2 symbols => point => 3 characters Made the following expression - var_dump(preg_match('/^([а-я]*[А-Я]*...
tirael8
1

votes
2

answer
24

Views

Replacing Relative Links with External Links in PHP String

I am working with an editor that works purely with internal relative links for files which is great for 99% of what I use it for. However, I am also using it to insert links to files within an email body and relative links don't cut the mustard. Instead of modifying the editor, I would like to searc...
Lee Wiggins
1

votes
1

answer
93

Views

Match a query within token in Whoosh

I want to apply a search with Whoosh on a text. Right now this works only for exact matches of tokens (space delimited). I'd like to match also within a token (e.g.: match add in a token 'added'). I know about stemming and variations, but this are not what I'm looking for. Thank you for your Help! f...
1

votes
1

answer
60

Views

Return Boolean mask of columns that contain a string

I have a Pandas Dataframe with say 5 columns. Some of the columns contain a string 'aa'. I want to return a list containing booleans that identify the columns that contain 'XX' Example cl1 cl2 cl3 cl4 cl5 1. ds fr we iu XX 2. sx XX ee ee nn 3. df vd rr we mm...
prre72
1

votes
1

answer
293

Views

Excel - search part of a string, vlookup value in table

I have two tables in Excel : In table 1, one column contains strings of data. The format is not structured but will always contain a keyword that I'm trying to match to a column in table 2. Example: 32984723987 BLA BLA &*& KEYWORD 232328 BLA In table 2, the first column contains keywords. The secon...
Bob-78
1

votes
0

answer
45

Views

RStudio: Compare two different data tables when row.name is same

I have two data frames with different columns and rows: One of the tables are specifically expressed genes names in rows (750 entries) with statistical analysis (p-val, fold change) in columns. (750x2 matrix) The second table is all expressed genes names(13,000) and their associated genes in the sam...
Umber Sheikh
1

votes
2

answer
70

Views

Finding the right vlookup/index formula in excel to match weeks and dates

I have two sheets on excel. Sheet1 consists of data from other sheets so Sheet1 is the main Sheet to look at. I am having trouble finding a vlookup formula that can get the accurate information from Sheet2. On Sheet1, in column A I have item numbers and in row 1 I have dates that alternate weekly (1...
user10101843
1

votes
1

answer
106

Views

How to compare preg_match_all case-insensitive arrays

I've used array_udiff() to compare case-insensitive arrays, this works fine with the code below i.e. the word 'flower' is found in both arrays whether it's lower or in uppercase. $array1 = array('sun', 'World', 'FLOWER'); $array2 = array('you', 'your', 'flower'); $result = array_udiff($array1, $arra...
Seb
1

votes
0

answer
17

Views

get common lines in two files with different number of cols

I have two txt files like this file1.txt >100kb ENSG00000004534 ENSG00000006453 ENSG00000011105 ENSG00000011275 ENSG00000014164 ENSG00000018408 ENSG00000028277 ENSG00000029534 ENSG00000039139 ENSG00000039560 file2.txt Chromosome Start End Strand Gene Name n. Totaln X...
Mia Lua
1

votes
0

answer
39

Views

can i use index match to do wildcards of multiple text in a string

i have seen a few discussions about using wildcards in excel but it seems to cover partial text as a single word: Finding partial text in range, return an index i want to be able to Index and MATCH by finding a word in string for example D4: 'bob jim fred gary' =INDEX(D7:D10,MATCH(''&D4&'',C7:C10,0)...
Chris Turton
1

votes
1

answer
57

Views

Regex match if statements that contain assignment operator

My requirement is to match all if statements that erroneously contain assignment operator instead of an equality operator (==). I am sure my regex lacks a lot but the first problem that I notice is that I am having trouble containing the regex to stop searching after an if statement closes e.g. ') {...
marioskamperis
1

votes
0

answer
93

Views

TextFile Comparer in C# using DiffMatchPatch trimming leading spaces issue

I was using https://github.com/google/diff-match-patch in my C# project to compare text files. Dump the difference into html and send it as an email body to my mail in case when difference was found. The way I'm using is the following: var dump = DiffMatchPatchModule.Default; var diffs = dump.DiffMa...
Max Skliar
1

votes
2

answer
223

Views

How to match multiple words via terms in elasticsearch

My query for matching multiple words is as following, {'query': {'bool':{'must':[{'terms':{'my_field':'word1 word2'}}]} upon execution, the result set is empty though data exists for the following query. Instead of above query, if I use {'bool':{'must':[{'terms':{'my_field':'word1'}}]} then elasti...
Sowmya
1

votes
1

answer
46

Views

How to preg_match KRA Pin no

While working on a human resource system, I had a problem of validating Kenya Revenue Authority's PinNo. The string should have a length of 11. The string should start with a letter a or A, then any number [0-9] and end with a character [a-zA-Z]. Here is my implementation: $pattern = '/^\A(a|A){1}\...
Githaiga Maina
1

votes
1

answer
24

Views

Excel function for searching/matching/pasting data from different tables

I have huge bank database from Bankscope which will be used in econometric analysis. I'm struggling how to associate bank statistics (table A, time period 9 years) with macroeconomic stats (table B, time period 9 years) from Eurostat. I'm searching for excel function which would search/match/paste...
user188263
1

votes
0

answer
56

Views

preg_match not allowing searches with spaces

Have looked around for solution to the issue. My search is getting JSON data from the musixmatch api however the search only works with single words, e.g searching 'mamma' or 'mia' returns results but searching 'mamma mia' is not returning results. The API is using UTF-8 and my document is set to th...
Daryl Roberts
1

votes
1

answer
28

Views

Match character and order

If I have data such as idx
giarno
1

votes
1

answer
16

Views

How to tell Regex that the searched match must be at the beginning or just after tabs?

I'm fairly new to regex, and I can't seem to get this working: I did some changes in one of my projects and thus I had to change variable names in multiple files. The variables were named as their class (variable lower case, Class uppercase; I know this was not good practice :D) and this confused me...
bitdealer

View additional questions