Questions tagged as 'regex'

2
answers

Convert a text link to a href link

I have a website where I have an editor (html) only q sometimes instead of using the button to post the link people paste the link and it gets into text so I'm a regular expression to convert the text to link $reply = preg_replace( "/(?<...
asked by 06.03.2015 / 23:57
2
answers

How do I make a regex capture a large variation of a term? (House House)

It is as follows: since I have a term that I want to capture, for example, "HOUSE", how to make a regex so that many variations of that word can be captured,    Home, CASa, CAsa, house, CaSA, CasA ... I know there are    (Home | CASa...
asked by 26.12.2016 / 20:07
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

Validate a string with Regex

I need to validate the name of a file that has the following name NWD[0-9] PADRAO - . The literal part will always be the same, what can vary are the numbers. I would like to know how to do this with Regex .     
asked by 12.04.2018 / 21:30
3
answers

How to get parts of a text in php

How to get text from part   ASUS Motherboard for Intel LGA 1151 ATX ROG STRIX Z270E GAMING, DDR4, Aura Sync, Gamer Audio, Intel Network, SLI / CFX, Wi-Fi, USB 3.1 Front, HDMI / DP " and    "price": 1095.9 Remember that depending on...
asked by 24.04.2017 / 16:24
2
answers

Separate script tag by semicolon

I have a variable that can store plain text and tags <script> and <img> , delimited by (';') . To separate information, I use the split(';') method. It works fine for texts and <img> , howeve...
asked by 21.03.2015 / 17:49
2
answers

Regular expression to capture after the last bar

I have the following URL: ("file:///home/pasta/pasta/img/intro-bg.jpg") I'd like to know what regular expression I can use to catch only intro-bg.jpg If anyone can help me, thank you.     
asked by 25.10.2017 / 20:13
2
answers

Regular expression (regex) for links in web pages using Python

I'm trying to learn how to create a webcrawler. Part of the code will be to extract links on a web page (links beginning with http or https): import re urls = re.findall(r'href=[\'"]?([^\'" >]+)', s) How can I modify or create a new r...
asked by 31.07.2016 / 18:57
3
answers

Regular Expression - Only numbers, no space

I have the following regular expression ' ((?:[\d][\s]?){5}[\d]) ' and I'm testing it on link . My problem is this: If I have this snippet ' teste 123456 teste ' it will only return me ' 123456 ' which is correct. But if it...
asked by 23.06.2016 / 19:40