Questions tagged as 'regex'

1
answer

"The input string was not in an incorrect format" when filtering array

After sending a string that is a command keyword to my Arduino via the serial port, I am trying to get values in an application in C #, and a certain string and puts them in two different arrays using regular expressions, however this giving the...
asked by 18.01.2016 / 21:17
3
answers

Validate zip code in Shell-Script

I am entering this world of regular expressions, I am with a doubt, I read about the metacharacters, etc. Well, I'm trying to validate a zip code and I'm using the following command and I'm not getting it ... I've already replaced \ d with [0-9]...
asked by 17.06.2015 / 15:22
2
answers

Capture data following pattern to last space

I'm trying to do a scrapping of a website, and would like to capture the value that follows the pattern below: Advogado: XXXXX Número do Processo: XXXXXX OutroCampo: XXXXX In general, what separates this information is a space, so what woul...
asked by 04.01.2019 / 01:13
1
answer

Regex - Remove between tag and start of class name and last tag closing

I have a string (html) and I need to remove everything that is between the first occurrence of <div class="c and first closing of the > tag and last closing of " </div> ". The first one should be this way because...
asked by 01.02.2018 / 14:50
1
answer

How to extract information via regular expression?

I have the following string: adapter-UDP02_sistem10_a.log How to extract the UDP02 excerpt via regular expression? The logic is: capture everything after the - (hyphen) and before the first _ (underline)     
asked by 25.01.2018 / 21:04
2
answers

Regex in MySQL to fetch certain results from X time

I have a field in the table set to DATE and the data is saved in this field as follows: year-month-day hour: minute: second Exemplo: 2014/04/22 18:32:00 I need to develop a query that returns me only given year / day / month. A scheme:...
asked by 27.04.2014 / 18:39
3
answers

How to remove brackets in a regex?

I'm using a regex to remove some characters, but as one of them is the brackets [] and I'm having problems with the regex replace(/[.!'@,><|://\;&*()_+=]/g, ""); . How would it be to remove this character in this function?     
asked by 30.05.2017 / 22:23
1
answer

Matching regular expressions with special REGEX symbols and line breaks

I need help in a regular expression that matches (% ) in a string whose: beginning is the end of a line with the character } continue marrying everything you find on the next line (including other escaped characters like \...
asked by 02.06.2017 / 18:47
1
answer

Separate strings by semicolons but also save semicolons

I'm using split to separate strings by space, enter, and semicolon, but when it's a semicolon I need to store it in a position in the array as well. How to do this? Current Code: String[] textoSeparado = texto.split(" |\n|;");     
asked by 14.10.2017 / 22:35
1
answer

regular expression php [closed]

I'm trying to get a whole source code from a website. using CURL I used the regular expression preg_match('/<html>(.*)<\/html>/i', $resultado, $codigo); echo $codigo = $codigo[1]; But it did not work ... where is th...
asked by 25.01.2017 / 20:39