Questions tagged as 'regex'

1
answer

Change to regex format '0.00' by format '0.00'

I need to do an insert in the database, but I have been sent the sql to import with the wrong culture (globalization or whatever). In this way the numbers in SQL are in this format: '0,0 ou '0,00' ou '00,00' ou '000,00' ou seja, aspa simple...
asked by 15.06.2016 / 18:11
1
answer

Why does not regex work?

I'm following the booklet OOP Programming with PHP5 by Hasin Hayder (2007) and got to the part of Unit Tests. In a given exercise, it builds a wordCount() method and creates some tests for this method, class WordCount { public fun...
asked by 11.03.2016 / 03:43
1
answer

How to extract a piece of an xml using PHP?

How can I capture / return everything between the <*:Body> and </*:Body> tags using PHP so that it does not matter how many lines exist before or after both tags? <?xml version="1.0" encoding="UTF-8"?><soapen...
asked by 13.08.2018 / 16:40
2
answers

Regular expression for Telephones with numbers only and C # DDD [duplicate]

I would like an help to create a regular expression in C # that validates number of phones with DDD but without points and dashes, only numbers. It would be in the format XX12345678 and XX 123456789.     
asked by 24.10.2017 / 14:54
1
answer

How do I get part of the string from the size of a word?

I want to take only the name of the subject of a h1 containing the following text: "ENF N1A METHODOLOGY OF SCIENTIFIC RESEARCH (MONTH)". In the case what interests me in this string is the value "METHODOLOGY OF THE CINENTÍFICA RESEARCH". The ide...
asked by 16.04.2018 / 16:53
2
answers

String containing numbers only

I need a regular expression for a string to receive only numbers, for example: "12454853", "12", "9012" These are valid, but I need them when a string appears as: "123g123", "123er*" Give it as invalid.     
asked by 26.10.2018 / 19:41
1
answer

Regular expression REGEX HELP

I have an array on the server in Nodejs, I'm going through html files and need to return the value that is in the middle of the span tag using a regular expression how would it look? { < span class="filteredAds"> de teste< /span>,...
asked by 28.01.2017 / 03:49
1
answer

How to make a regex that accepts 8 or 9 digits with 2 digit DDD?

I have pattern code: ^[1-9]{2}9?[0-9]{8}$ , so I changed my mind to do with regex with mask and such ... Example: (11) 1111-1111 - fixo válido (11) 11111-1111 - celular inválido (11) 91111-1111 - celular válido...
asked by 29.01.2018 / 18:57
1
answer

Regex, if the variable contains a certain character

I have a link by exexplo: <a href="#sessao">Sessão</a> And another link: <a href="https://...">Link Externo</a> I would like to know how, I believe by regular expression, a way to test if my link contains "#", s...
asked by 15.07.2016 / 22:48
3
answers

How to replace the extension but remain the title

I have a folder, which contains several videos with different names and different formats: link link link link And so on ... How do I give two download options to visitors. I have to change one of them. See: func...
asked by 07.04.2017 / 20:27