Questions tagged as 'preg-match'

0
answers

preg_match returning mag_glass

function returnvalue($namearr,$exec){ $result=""; foreach($namearr as $arr => $value) { $regex = '<.* name="'. $value .'".*>'; if (preg_match($regex,$exec,$result1) === false) { $result4=" FALSO OFFSET...
asked by 15.03.2015 / 00:18
2
answers

How to use preg_match () to get a link inside a Javascript code

Hello, I'm doing a file_get_contents() in PHP and getting a JS, in that javascript has a code where it contains: $("#download-botao").attr("href", "link.com"); I want to get this link.com in my PHP, I'm trying to preg_match() ,...
asked by 01.08.2018 / 01:25
2
answers

Get DDD in (11) with regex

I need to get the DDD that is among the Parisians: (11) 9.9999-9999 I tried to make a regex but I did not succeed. I'll use PHP to get it, but I needed a regex for it. Someone could give me a hand.     
asked by 14.06.2018 / 02:18
1
answer

About Regular Expression in PHP - How to Take Part of a Text? [closed]

I'm having trouble catching part of a text from a page on the WikiPedia . I can get the title like this: $content = file_get_contenst("https://pt.wikipedia.org/wiki/Conserva%C3%A7%C3%A3o_da_natureza"); preg_match("/< title>(.*?)&...
asked by 26.09.2016 / 01:23
1
answer

Catching with preg_match email with PHP special characters

With this code below it does not handle underline emails. Is it possible to modify it to take even underline and other special characters? In the example below it returns the value "[email protected]" and the correct one would be "aline_ca@ho...
asked by 15.08.2016 / 01:46
2
answers

php search for p content

How can I get the 'VALOOR' <p id="sinopse2" style="display:block !important;">VALOOR</p> I tried this code: preg_match_all("#<p id=\"sinopse2\">(.*?)<\/p>#s", $string, $encontrou); But I did not succeed; (     
asked by 26.07.2018 / 23:57
2
answers

How to use the PHP preg_match command

How do I use preg_match to detect a string where it has to start with "/ command"? This function, for me, is very complicated to understand ... I wanted to detect a / command at the beginning of a sentence and get the rest of the st...
asked by 06.04.2018 / 15:49
1
answer

preg_match_all, regular expression in php with variables

Hello, I'm having trouble with the regular expression, and the function returns 3 positions in the array all empty; preg_match_all('/<a data-role\="sku\" data-sku-id\="'.$the_new_id[2].'\" id\="sku\-3\-'.$the_new_id[2].'\" href\="javascript...
asked by 18.03.2018 / 22:34
1
answer

Preg_Match w / regular expression

I need to remove everything around the link below. I'm using preg_match with regular expression, and since I'm new to the area, I'm having trouble finding my error. Could you please help me out? How do I do: preg_match('/www.facebook.com/pl...
asked by 22.02.2018 / 19:32
1
answer

REGEX to get information inside a string

I'm studying PHP OO and part of my study is in putting together a Class that works a template engine. I've converted the file to a string with file_get_contents and now I want to get a part of that string to generate a LOOP. {LOOP} <opti...
asked by 10.01.2018 / 05:28