Questions tagged [rlike]

For issues relating to the RLIKE synonym for the REGEXP MySQL operator.

RLIKE is a synonym for the REGEXP MySQL operator. It performs a pattern match of a string expression against a pattern. The pattern is supplied as an argument.

Sample:

SELECT 'Michael!' REGEXP '.*';
64 questions
0
votes
2 answers

Including parenthesis when joining dataframes using rlike in pyspark

I have 2 pyspark dataframes that I am trying to join where some of the values in the columns have parenthesis. For example one of the values is "Mangy (Dog)" If I try joining like so: df1.join(df2 expr("df1.animal rlike df2.animal_stat") I don't…
thentangler
  • 1,048
  • 2
  • 12
  • 38
0
votes
2 answers

Pyspark: How to filter dataframe based on string and absence of prefix?

I have a pyspark dataframe like so with rows that have 'zodiac' and rows that have 'nonzodiac' spark.createDataFrame( [ (1, '1234ESPNnonzodiac'), (2, '1234ESPNzodiac'), (3, '963CNNnonzodiac'), (4,…
sanjayr
  • 1,679
  • 2
  • 20
  • 41
0
votes
1 answer

How does RLIKE in Spark SQL treat the % char

I have a table with a column that holds raw query strings. I want to find all the query string that match a certain patterns. some patterns starts with the % char. I was wondering if the RLIKE in spark SQL behaves like the LIKE command in SQL or…
Mr T.
  • 4,278
  • 9
  • 44
  • 61
0
votes
1 answer

How to write RLIKE in zend framework 3?

I have a raw query something like: SELECT * FROM caps WHERE `items` RLIKE '[[:<:]]20003[[:>:]]'; I've converted this query to 'zf3 select' format. I'm using Zend\Db\Sql\Select and extending TableGateway. Here is the converted zf3…
0
votes
1 answer

How to extract column value to compare with rlike in spark dataframe

I have the below code in spark 2.3 .It shows error since rlike can only evaluate a string but not a column field, So I want to extract the value in corresponding col(unique_handle_regex) column as string val df3 =…
minnu
  • 57
  • 1
  • 8
0
votes
1 answer

HiveQL - Rlike to a regexp in a field?

Can you use rlike to join a table using regular expressions contained in a field? i.e. Select a., b. from Table a inner join Table2 b on a.Field rlike b.Field2 i.e. Table 2 data: Field1 Field2 David ^D(a|o)vid Test a ^Test
dnf999
  • 33
  • 2
  • 5
0
votes
3 answers

MYSQL REGEXP/RLIKE Advice?

I have a table called "scholarships" that has a field named "majors" which contains comma separated major names for the majors the scholarship is related too. Let's say the field could contain one (or more separated by commas) of the following:…
sitesbyjoe
  • 1,861
  • 15
  • 21
0
votes
0 answers

MySql REGEXP or RLIKE UPDATE

I've been reading some question and I realized that REGEXP or RLIKE doesn't support the UPDATE function, so here's the deal: I got a table called email_accounts and a column login, in that column there's some data who have some capital letters in…
0
votes
0 answers

MySQL in R: using sqldf and RLIKE

I am trying to run a huge boolean sqldf in for a local dataframe in R like so: sqldf("UPDATE df SET STORE_FLAG = 1 WHERE CONTENTS RLIKE '(([[:<:]]store[[:>:]]))'", drv='SQLite') Query abbreviated above. The actual query is 20 words long with near…
lmcshane
  • 1,074
  • 4
  • 14
  • 27
0
votes
1 answer

Regex to extract first two octets of IP address in hive

I want to extract only first two octets of IP address in hive. Can anybody please tell me equivalent Regex supported in Hive? For example,extract '192.96.0.0' from ip_address '192.96.45.33'.
rupali
  • 165
  • 1
  • 3
  • 11
0
votes
0 answers

MySQL RLIKE repeating character end position

I have done my due diligence and am still stuck. I have a situation where I need to locate where the last existing same character is in a search string, then check to see what follows that character. I think I need to use RLIKE to do this but maybe…
0
votes
1 answer

mysql - regex - rlike with 1 and without 10

I've got a mysql table with the following data: ID | Name 1 | xy 4 | dasd 9 | 422p 10 | dasös and I've got the following query which should display only the values "1 and 4", but it displays 1,4,10. rlike '1|^4' any idea?
Stefan
  • 13
  • 4
0
votes
1 answer

Advanced MySQL search query - using RLIKE

Im working on a MySQL search query for a product search module in Joomla/Virtuemart. I am actually trying to modify an existing MySQL query from using MATCH / AGAINST to using RLIKE, but my modified query gives errors.. Here is the original query…
GeniusDesign
  • 499
  • 7
  • 25
0
votes
1 answer

Hive RLIKE on a JOIN synthax

I have two tables on hive. The first, called 'access', contains apache logs, where the first field is an complete ip adress : 10.4.5.12 - - [26/Jun/2010:11:16:09 +1000] "GET /myportal/pageA HTTP/1.1" 10.4.41.2 - - [26/Jun/2010:11:18:09 +1000] "GET…
Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48
0
votes
1 answer

Mysql RLIKE / PREG_MATCH bug

Cold someone could explain why this returns true: SELECT BINARY 'â' RLIKE '[™]'; SELECT BINARY 'é' RLIKE '[©]'; What could be the fix ? Is it some misconfiguration on my part? UPDATE: found that using (™|©) instead of [™©] would work as a first…
Stefan Rogin
  • 1,499
  • 3
  • 25
  • 41