Questions tagged as 'regex'

1
answer

Validating a field in a REGEX form

Good morning, I have the following problem: I have a regex that validates the following situations: Do not contain dot, space, accents and / or capital letters "^ [a-z0-9] * $" I also wanted to include so that I would not allow numbers just as a...
asked by 12.01.2018 / 13:45
1
answer

regex stop if the charactere next is another

Next: I have this text for example aluno['ACERTOS_ATV2_D2'] >5.5 & aluno['IDADE'] >24.5 & aluno['PROVA1_D2P'] <0.5 & aluno['ASSISTIU_AULA_1_D2'] <0.5 & aluno['FEZ_FORUM_D2SIM'] > 0.5 I need to ma...
asked by 29.12.2017 / 13:11
1
answer

Capture digit in parentheses

I have several types of texts, for example: $ticker="08.070.838/0001-63.offset(1)" . I want to capture the text and the digit, if any, that is enclosed in parentheses to make it the "08.070.838/0001-63.offset+1" form. I am try...
asked by 08.11.2017 / 14:54
1
answer

Verify occurrence in REGEX for files in php

In php, I have to open a system file and check if after 10 of a char in the case "; " what is the content right after it. example: TPD;62384;P;;;;N;62308;N;;C;N;N;;F;02 what would be the regex for this purpose?     
asked by 19.09.2017 / 20:18
1
answer

Capture groups where a specific word appears with Regex

I have the following situation: text_1 = O cachorro correu com o gato text_2 = O carro passou e o cachorro foi atrás text_3 = Sempre que chego em casa meu cachorro pula em mim text_4 = Ele foi correndo atrás do sonho text_5 = O cachorro latiu...
asked by 10.08.2017 / 18:49
1
answer

Rule conflict in .htaccess

I'm facing an error with the .htaccess file and I'm not getting resolved, it's the following: I have the following rule: RewriteRule ^([^\.]+)$ $1.php [NC,L] This rule aims to ignore the .php extension of all files accessed in my directo...
asked by 24.08.2017 / 01:48
1
answer

Validating file extensions with regex in c ++

#include <regex> #include <iostream> bool is_source_file(const std::string& source) { std::smatch source_match; const std::regex pattern("(?:(?:[a-zA-Z0-9_.])?(c|C|h|H|x|X|.?xx|.?XX|.?pp|.?PP|.?++|.?h|.?H|.?tm|...
asked by 22.07.2017 / 19:11
1
answer

Friendly URL with htaccess pointing

My site is in a subfolder, I want the path to work regardless of what I enter in the subfolder name, for example: www.mydomain.com / any-thing / index.php www.mydomain.com / any-thing1 / index.php www.mydomain.com / any-thing2 / index.p...
asked by 28.06.2017 / 16:27
1
answer

I want to do a phone validation but how do I validate the trace also in case the user places it?

This is what I have so far: public static function ValidaFone($RegeEx) { $RegeEx = preg_match('/^[0-9]{9,11,13}$/',$RegeEx); ........code..... }     
asked by 28.07.2017 / 16:18
1
answer

Capture all phones from a text file

I have a log records in html, and would like to capture all the landline and mobile numbers that are scattered around the file, I use the following regular expression currently: /(\(?\d{2}\)?) ?9?\d{4}-?\d{4}/ , only it is letting pass som...
asked by 13.06.2017 / 05:46