Questions tagged as 'regex'

2
answers

Php preg_replace swap image src

I would like to know how to add the url of the site in front of the existing src of all the images of an example string: <img src="images/teste.jpg" border="0" width="486" height="370" style="margin: 5px; float: left;" /> <img src="im...
asked by 01.08.2015 / 20:33
1
answer

Data Regex Validation

Good Morning ... I'd like to know how I can validate a date! Where the Final Date can not be less than the Start Date (dataFinal ) with regex!     
asked by 02.09.2015 / 15:50
4
answers

Regex in Python to find several possible names

I need to find the judge's name on a labor file, but first I need to know if he is a Judge, Rapporteur, Rapporteur, or Judge. I'm using the following Regex: f_regex = re.compile(r'ju(iz|íza) relato(r|a) | ju(iz|íza) | relato(r|a) | desembar...
asked by 20.12.2017 / 18:56
1
answer

Regular Expression | Catch part of content between 2 markers [duplicate]

I do not have any regular expression knowledge, so I do not know if it's possible to solve my problem.    In all the HTML of a website, it always has code similar to this. "placeholder":"https:\/\/ci.hdv6.com\/videos\/78\/13\/8787575\/th...
asked by 06.08.2018 / 02:23
1
answer

Treat list of CNPJ's with regular expression

I have a list of CNPJ's, I would like to take this list and add single quotes and separate each with a comma, doing it with regular expression. Eg: My list:    32132132132 32132132132 321321321323 32132132132132 How do I wish to stay:...
asked by 26.03.2018 / 19:54
1
answer

Concatenate strings in Javascript [duplicate]

I have the following function, which changes the numeric value of a string when found: var original = "Este aqui é o valor do cliente 000.000.00 01"; var original = str.match(/\d\d\d\.\d\d\d\.\d\d \d\d/) var novo = "129.000.000 02"; original...
asked by 24.05.2014 / 00:45
1
answer

Do I need a function to return true or false, depending on the number of letters

boolean b = mascara.matches("\D{0,4}"); I need a mask (such as "GHO-1A23" ) to be checked that contains only 4 letters. If you have 4 just type in a number and if you have less than 4, enter another letter. But in this way, it retu...
asked by 31.10.2018 / 14:36
1
answer

Doubt regex use information after the "_"

I have the string: NeName = MGLUE_EPCVMH_UGW01 I need the first 3 letters after the first "_" Can you help me?     
asked by 29.08.2018 / 20:22
3
answers

How to remove whitespace from a string with RegEx in PHP?

How would a RegEx in PHP eliminate more than one blank string ? For example, <img src=' smiley. gif'> would like you to <img src='smiley.gif'> .     
asked by 23.08.2018 / 14:54
2
answers

Finding strings in a log and other patterns [closed]

I'm trying to identify two strings in a log file: "connected" and "disconnected". But I'm not sure how to make it work. On my server I have stored several log files import os import time import re data = time.strftime("%d.%m.%Y") logs = [...
asked by 20.12.2017 / 00:06