Questions tagged as 'preg-match'

1
answer

Warning when using preg_match ()

I had to migrate from PHP 5.2 to 5.3, so thousands of DEPRECATED messages started coming in my PHP system, but some are too complicated, follow the code: if (!preg_match($SUBMENU.':', $sm)) { $sm = explode($SUBMENU.":\n", $sm); $sm = t...
asked by 16.03.2015 / 01:10
1
answer

Rule PREG MATCH appropriate

I created a loop that shows all the months of the year with the following code: for($i = 1;$i <= 12;$i++){ } Then I created a $ _GET variable that would receive a rule like the following: 1,2,3,4,5,6,7,8,9,10,11,12 This is the $ _GET...
asked by 20.11.2017 / 17:27
2
answers

How to modify specific parts inside an html file?

I'm loading an html file and would like to modify urls inside it so that the system recognizes the actual path of every file the html is trying to access, so I have several different urls: <link rel="stylesheet" href="assets/vendor/font-awe...
asked by 24.03.2017 / 14:22
2
answers

Regex filter only values in real

I have the following regex: preg_match_all('/([0-9]+[\.]*[0-9]*[\,.]*[0-9]*)/', $string, $matches) If I get a string:    1 - João da Silva number 123456 with the value of R $: 6,298.65 I have a return: array (size=27) 0 => str...
asked by 16.03.2018 / 13:50
2
answers

Regular expression to filter the first paragraph between tags using PHP

I need to extract the first paragraph of an HTML code using Regular Expressions. Goal: grab only highlighted content in green: HTMLCode<divclass="text"> <p><span style="font-size:16px">As notas...
asked by 06.10.2018 / 17:41
2
answers

problem with data validation preg_match

Hello everyone, I have a form validation problem where my preg_match works perfectly, but it does not allow spaces, does anyone know how to let the user insert spaces between words? if(preg_match("/^[a-zA-Z0-9]+?$/i", $string)){     
asked by 19.09.2017 / 02:04
1
answer

preg_match regular expression to get text between tags

What would be the preg_match expression to get the text "exit" within the following tag? <a href="/logout" role="menuitem"> <i class="icon-key"></i> Sair </a>...
asked by 10.07.2017 / 06:22
1
answer

Error with Php and Preg_Match

I have the following line in a php file if(preg_match("!\oa!", $id)){ Until about 2 months ago this worked normally but started to give this error    Warning: preg_match () [function.preg-match]: Compilation failed:   missing opening bra...
asked by 15.10.2016 / 01:34
1
answer

Difficulty getting information through Regular Expressions

I'm having trouble getting information using preg_match_all . This information is being taken from an HTML code of an intranet page, but from the information I need, I am only able to collect one. Here is a piece of code that contain...
asked by 02.07.2015 / 19:41
1
answer

PHP: How to use preg_match_all in this section?

Site I want to get the data I need to use preg_match_all to get what's inside <table class="grid-table survey-info" cellspacing="0"> For the moment I did the following <?php $url = 'http://metadados.capes.gov.br/index.php/c...
asked by 21.11.2017 / 17:54