Regex Matches all characters between text and symbols

EXAMPLE: CODE: 123456 / NUMBER: AA1234567890 I want to extract the CODE with one RegEX and the NUMBER with another. I started with the first one and tried: (?<=CODE:)(.*)(?=/) The idea is to TRIM the matches afterwards, however, the RegEx above does

Python Pandas partial match of the chain

I created a dataframe df where I have a column with the following values: category 20150115_Holiday_HK_Misc 20150115_Holiday_SG_Misc 20140116_DE_ProductFocus 20140116_UK_ProductFocus I want to create 3 new columns category | A | B | C 20150115_Holida

How to mark observations with given information

Considering the data collected with 5 minutes time interval with a numeric variable a,and a discret variable acc, which represents if there's any incident happened(0 for no incident while 1 for incident): a<-c(1:(288*4)) t<-seq(as.POSIXct("2016

logical and if inside scala match cases

I need to use bunch of match case in scala, how do I use for or if inside the match case, so for example: import scala.util.Random val x = Random.nextInt(30) val result = match x { case 0 to 10 => bad case 11 to 20 => average case 20 to 30 => coo

Support with regex

I'm having a problem with getting only the nth match of a pattern. Here is what I'm trying to do: I have the following text and I'm trying to only get the third match: /* Line 1: this is line one Line 2: this could also be line one Line 3: this is th

Perl is a unique occurrence pattern in a string

I have a list of names and I want to look for names containing two given letters asigned using variables. $one = "A"; $two = "O"; Please note that I want those letters to be present anywhere in the checked names, so that I can get outp

Excel INDEX MATCH when the value can be in one of 3 columns

I am using INDEX/MATCH to find values in a single column and return the value from a different column using: =INDEX(Sheet1!$A:$A,MATCH(A2,Sheet1!$B:$B,0)) This will search to see if A2 matches a value in Sheet1 column B, and if so will return the val

php regex read specific lines

I have a problem. I'm trying to count number of a subtitle lines with php. As you might know, a subtitle looks like this: 1 00:00:00,984 --> 00:00:03,503 All right, guys, let's get to it. 2 00:00:03,587 --> 00:00:04,821 What's that button? 3 00:00:0

Delete rows containing specific strings in R

I would like to exclude lines containing a string "REVERSE", but my lines do not match exactly with the word, just contain it. My input data frame: Value Name 55 REVERSE223 22 GENJJS 33 REVERSE456 44 GENJKI My expected output: Value Name 22 GENJ

Excel so equal and match are not returning the same thing

I have put two date time values in cells A1 and B1. The date time is precisely 41703.0416666667. One is ouput from an SQL database the other manually written. The result of =if(A1=B1,1,0) is 1. The result of =MATCH(B1,A1,0) is #N/A. Does anyone have

Regex matching the pattern with a string

I am implementing a method which need to find if the string corresponds to some pattern : I am using the following code : if (Regex.IsMatch(str, @"^[\d]{3}00{\d]{4}$")) { return false; } return true; And test it with this string "123003678&

Regular Expressions - is the name of the building

I have a link like this: http://cdn.guerretribale.fr/8.17/19077/graphic/buildings/mid/main2.png?e3ea3 ... or: http://cdn.guerretribale.fr/8.17/19077/graphic/buildings/mid/barracks1.png?691e9 I want to get the building name, in first link is: [...]mid

Regex PHP Split number and string

I would like to split a string contains some numbers and letters. Like this: ABCd Abhe123 123ABCd Abhe ABCd Abhe 123 123 ABCd Abhe I tried this: <?php preg_split('#(?<=\d)(?=[a-z])#i', "ABCd Abhe 123"); ?> But it doesn't work. Only one

How to print unmatched data after comparing two files?

I have two files here (file 1 & file 2). I would like to match name in bold as shown below from both files. However I need to print those unmatched data in file 1 format. I have been trying the code below but it is not the result I want. How to print

SQL gets lines in the style '= ALL'

I have simple many-to-many relation in table Product_Category (MSSQL 2008 r2): CREATE TABLE #Product_Category (ProductId int, CategoryId int); go INSERT INTO #Product_Category (ProductId, CategoryId) VALUES (1, 200); go INSERT INTO #Product_Category

negative number in parentheses using javascript

I use match to split a mathematics expression into separated strings and save them in an array. var STRING = ST.match(/\d*\.\d+|\d+|[()/*+-]/g); but this method separate everything including negative numbers which are inside parentheses. For example

How to reverse the operation of the regexp pairing in mysql?

Let us say I have a table users table with a column name and it has the following records: charlie sheen charl een arnold Can I get the records that will match with "charlie sheen" without looping each item? To be more specific: Is there a way t

Match values ​​from two different tables

Given 2 tables, TableA and TableB, how can I get the "id"s of TableA when the "value" doesn't match with any "value" of TableB? Table A +----+-------+ | id | value | +----+-------+ | 1 | a | | 2 | b | | 3 | c | | 4 | d | | 5

javascript match replace text

quick question, I have some markdown HTML content that I'd like to convert from double asterisks to bold. the error i'm getting is: `Uncaught TypeError: Cannot call method 'replace' of null ' here's the jsfiddle: http://jsfiddle.net/fz5ZT/9/ here's t

MySQL in Python, MATCH and injection attack

Is MATCH from MySQL also vulnerable to injection attack? For example: """SELECT * FROM myTable WHERE MATCH(myColumnName) AGAINST(%s) ORDER BY id LIMIT 20""" % query seems to allow arbitrary strings, which looks bad. If so, I'

RegEx PHP gets text between multiple span tags

I don't speak English very well. So, if i'll make some mistake please sorry. On the site i have a div box with some information about game: <span class="noteline">Developer:</span> <span class="subline">Gameloft</s

Mysql string contained in a search string

What I need seems simple, but I haven't been able to pull it off so far. Maybe it's just these late hours, or maybe it's not that simple after all, I don't know any more :) So, here's the thing. I want to be able to check whether the search string fr