Questions tagged as 'regex'

2
answers

How do I get a value between brackets in the string?

I have a string that will vary the values, I need to get the values inside the [], {"time_zones":[]} In case it would be empty, it could be filled: {"time_zones":[teste]} I'm trying to do this var palavras = a.Split('['); var palav...
asked by 13.06.2018 / 21:24
1
answer

Problem with Regular Expression

I have this regular expression in php that should find the default in the name of a file. Example: dge_ANEXO_II_F_TJ[1].pdf But I can not get it to work. Can anyone help me? '/[a-z]{3}_ANEXO|Anexo|anexo_[A-Za-z]{1,7}_[A-Z]{1}_[A-Z0-9...
asked by 10.11.2015 / 20:12
1
answer

String search with "|" character

I need to perform a query in a txt file in Python, however I have 2 problems due to the interpretation of special characters. When I enter | or \ the result ends up being replaced: | is interrupted as white space and \...
asked by 04.09.2018 / 15:45
2
answers

Extract portion of characters using PHP

Hello everyone, I have the following string: '<a href="http://localhost/mensageiro/1990/">1990</a>&nbsp;(1) <a href="http://localhost/mensageiro/1994/">1994</a>&nbsp;(2) <a href="http://localhost/mensageiro/1...
asked by 27.03.2018 / 04:17
2
answers

Estimating the response time of a server using Python or regex

I created a virtualized environment with an Apache server (running in Debian) and several attacking machines running Debian as well. We used VMware Workstation. Server IP: 192.168.91.5 I have dump file (PCAP) collected with tcpdump. Is the...
asked by 20.09.2017 / 18:18
1
answer

Enter 0 when you have 10 numbers

I have the following sequence: 3531399402 It has 10 numbers, with this regex I can list these occurrences: ^\d{10}$ I'm using a text editor and I need to give a replace on those instances and insert a 0 before getting like this: 0353...
asked by 29.05.2017 / 17:12
1
answer

Remove tags generated at the end of the string of a Text Editor

I'm using a text editor and like others I've used, it always generates some useless tags that I'd like to remove. I can remove the last one, but sometimes it generates more than once. My code: def remove_useless_tags(message): message =...
asked by 09.11.2018 / 21:06
2
answers

Capture words using Regular Expressions

I have the following text example:    MyRelationsPDF001-Cover-Disclaimer-22012017 I want to capture with php regular expressions the texts    "Cover", "Disclaimer" and "22012017". I'm trying to use the preg_match_all() funct...
asked by 02.08.2017 / 17:31
2
answers

How to make a preg_replace with several conditions and several changes?

How to make a PREG_REPLACE having several search and multiple substitutions at the same time For example, I want to ('/(BR|BL)/', 'B') if you have BR and BL replace with B and also ('/PH/', 'F') if you have PH replace wi...
asked by 02.09.2016 / 17:54
5
answers

Capturing dates of a text using regular expression in javascript

I have a function that returns data in JSON and places it in certain places with jQuery. One of these data is text that contains a date range (Start and End). Example of returned text: ESPÍRITO SANTO - Status: This is how much the Brazi...
asked by 11.03.2014 / 19:15