Questions tagged as 'regex'

1
answer

Regex - Regular Expression to get a block of text

How would a regex be to capture the block of variables declared in a delphi unit? The closest I got to this was using this var[^=]*[^\)]; but with no success. var Variavel1 : string; Variavel2, Variavel3: integer; Variavel4, Variavel...
asked by 16.07.2016 / 01:19
1
answer

Regular expression, preg_match (), and storage in an array

Hello . I have a .txt ( pastebin ) that contains the log of the connected clients on a server openvpn and the format of each of the lines is as below: CLIENT_LIST orion-01889596000195 177.43.212.110:28763 172.16.191.145 872199 8...
asked by 30.05.2016 / 06:05
2
answers

How to return letters between points using a regular expression?

I'm using Google Drive and would like to use a regular expression to separate the characters between points, as below:    a · bai · xa · men · to   a · bai · xo I need to put in each column the content between the points (in the first an...
asked by 06.04.2016 / 12:46
1
answer

Get content from a div and save it to an array with regular expressions (PHP)

I would like to know how I can get the contents of the div with class="x-product" and save it to an array so I can manipulate them later. I tried this code but it did not work. <?php $url = "http://www.megamamute.com.br/hardware/placas-d...
asked by 07.03.2016 / 16:31
1
answer

Link being replaced in the wrong way when using preg_replace

I have an array with regular expressions that I use to replace url's / hashtags on links using preg_replace : $regs = array('!(\s|^)((https?://|www\.)+[a-z0-9_./?=;&#-]+)!i', '/#(\w+)/'); $subs = array(' <a href="$2" target="_blan...
asked by 11.06.2015 / 22:00
1
answer

Get value from a Span field with cURL Parser

I have a question and a problem. Well it's the following with cURL I login beauty up so far .. ok but I need to get some information that is inside the html: <span id="Number">12345678993</span> <span id="holderName">RAFAELA...
asked by 05.02.2015 / 21:21
4
answers

Decrease field value span with preg_replace

I'm trying to change all the values of fields containing span class . Example the site looks like this: <div id="isOffered"> <a class="price addBetButton footballBetButton" id="bk_82285689_mk_sel1" href=""> <span...
asked by 23.02.2015 / 01:56
0
answers

Validate namespace definition

PHP variables, if necessary, can be validated with the following Regular Expression: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* But what about namespaces ? I have a certain string, coming from a form, which will serve as the name of a dir...
asked by 04.12.2014 / 14:20
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

Format date with javascript [duplicate]

I'm developing an application in which I get the postings of a page on facebook and I need to format the creation date of the post I get via json as follows: 2018-01-12T11:25:41+0000 What function should I use to format this date into the...
asked by 12.01.2018 / 18:11