Questions tagged as 'regex'

0
answers

Regex for name validation with posix regex

I have a function in c++ that validates first and last name with the following regex : "((?:[á-úA-Za-z]+[ ]+[á-úA-Za-z]{0,20})?)?" I was taking a look at letting you learn how to create regex otherwise based on what's he...
asked by 28.01.2018 / 13:29
1
answer

Regex can not find all the required expressions

Hello, I'm new to python, and I'm probably taking a very amateur approach to the problem. I'm trying to find N-digit sequences in .txt files (in example N = 17). I have thousands of files and I've been creating regular expressions for the most c...
asked by 23.11.2017 / 20:20
1
answer

Divide text into parts

I need to get a specific piece of a .txt file that is between <tag> and </tag> . But I need to get all the lines where it happens. Example: <tag1>titulo</tag1> <tag2>subtitulo</tag2> texto....
asked by 22.11.2017 / 19:38
0
answers

Regular expression in Laravel

I'm not very good at regex but using the link site I was able to generate an expression that accepts: Do not accept special characters You can have up to 5 words separated by whitespace The generated regex: (^\w{0,30}){1}(\s?(\w{0,...
asked by 11.06.2018 / 03:44
0
answers

Complete expression

Well, I have something like this: /^perfil[\/]?([0-9]{3})?[\/]?([a-z]{4,5})?[\/]?/i You need to create a function that, when receiving the information, transform it into perfil/431/abcd/ perfil/431/abcd perfil/431/ perfil/431 perfil/ perf...
asked by 08.12.2017 / 14:22
1
answer

Only uppercase and lowercase letters and accents in regular expressions [duplicate]

How to create a regular expression in the right way where it accepts only uppercase and lowercase letters, along with accents? This is to validate a string name, I created it as follows: $String = preg_replace("/([^a-zà-úA-ZÀ-Ú ])...
asked by 24.12.2017 / 07:10
2
answers

Error while validating with Regex

I'm trying to format this text with regex but I do not have the desired return: From:    "ST STN, SET J, * STORES T-40 / T41, - TER-REO, SHOPPING &   BOULEVARD KM 28,5 VALUE 450.00 CENTRAL. " To:    "ST STN CONJUNTO J LOJAS T40 T...
asked by 20.04.2017 / 20:49
1
answer

How to get the last occurrence of Virgula [PERL]

Well I have a perl script that formats a json by leaving it in this format: {"nome1":"123","nome2":"123","nome3":"123",} But I want only the last occurrence to be just the key without the comma before. like this: {"nome1":"123","nome2":"1...
asked by 18.09.2017 / 16:56
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
1
answer

How to create a friendly URL with undefined parameter number

Hello, would anyone know how to do this regular expression in .htaccess? I need to leave the friendly URL pattern in this format: http://dominio.com.br/usuario/joao.json http://dominio.com.br/usuario/adriano.json http://dominio.com.br/usuar...
asked by 10.10.2016 / 21:34