Questions tagged as 'regex'

2
answers

Get content that is before the number using regex

$MinhaString = "Aventura, Fantasia, Ação 25 de maio a 31 de maio" I tried to do so, but it does not work. $Genero = strstr ($MinhaString,"/[^0-9]/",true); I just need the "Adventure, Fantasy, Action". The date is not static.     
asked by 26.05.2017 / 23:22
1
answer

regex to replace the $ _POST ['field'] string with $ this-input-post ('field') of codeigniter

I am trying to find a way to replace the $_POST['INPUT'] by $this->input->post('INPUT') of codeigniter , in my editor phpstorm , using replace with the regex option enabled. > So what's in quotation marks that is the na...
asked by 01.06.2017 / 17:30
2
answers

Find attribute value with regex

I get a string from an RSS feed, the part of which is of interest: <table feedtag="divinegoblin" ... Each piece of the feed will always have this feedtag="..." attribute. I would like to get the value of this attri...
asked by 14.06.2017 / 02:29
1
answer

Delete a string with replaceAll

I have a string, example: &texto-outroTexto=09213sdadwqWDQS Where "09213sdadwqWDQS" would be any text and "&texto-outroTexto=" would be a fixed text. I wanted to do the Regex of this string. I did it that way, but i...
asked by 30.05.2018 / 19:21
1
answer

Capture with regex a certain part of the string

In this sentence, /comprar/volkswagen/gol/11184529 , I would like to capture if there is the word comprar what comes next without the / , that is, I would like to capture the word volkswagen (but could be another...
asked by 08.06.2018 / 21:01
1
answer

mysqli_query returns false to select done with REGEXP

I'm having the following problem: I'm trying to capture a table row from my database using a regex, and by typing the code into the Mysql terminal, it catches the line normally. In my php code, mysqli_query () always returns false with these sam...
asked by 10.06.2016 / 01:55
2
answers

Automatic line wrap with regex

I have the following string: $var = "Saudi Arabia U23 x South Korea U23"; I want to split the names that are separated by "x" , I did the following: $arr = preg_split('/[v|x]/', $var); I used% w /% because sometimes the string...
asked by 07.01.2016 / 18:57
1
answer

Validate Google Site Verification URLs with Regex

With $ _SERVER ['REQUEST_URI'] I have captured the following address below! /google9f7804416f93fdd6b.html I need to perform a validation with ER, the function must recognize the word Google parâmetros randômicos 9f7804416f93fd...
asked by 30.08.2015 / 02:18
1
answer

Regex - Replace process time too high

Recently after developing a process, I saw that it was taking an exorbitant 5 ~ 6min to run, something that should take a maximum of 2s, so I started to debug the code with timers to know which process was taking so long to be accomplishe...
asked by 19.08.2015 / 15:36
1
answer

How do I create a String model and whenever the user passes something different report the error?

I need a String template that starts with a letter, has no space, accepts numbers, is case sensitive, and does not accept special characters or accents, (it will be the name of a table in the database ) so I wanted something that would work as a...
asked by 10.11.2014 / 13:09