Questions tagged as 'regex'

1
answer

Extract last numbers with Regex

I have these two examples of strings : /news/uk-news/commuter-who-extraordinary-row-woman-12345 /news/weird/dude-who-killed-14-extraordinary-98765.amp I want to get only the last numbers, 12345 and 98765 , respectively. In...
asked by 09.12.2017 / 03:07
1
answer

REGEX JAVA Find an excerpt throughout the document

I'm trying to develop a Regex expression in the JAVA language to find and validate the existence of a small sequence of characters within a .txt. Exp: Validate the existence of the TDT+20+LA8031+++LA' string within the text below:...
asked by 15.09.2017 / 21:00
1
answer

Is the order of evaluation of alternatives in a regular expression always taken into account?

I was developing a function that took a logical sequence of characters, let's call it a query, this query represents simple expressions separated by ; , expressions can contain any of these operations: == , !+ , > ,...
asked by 24.08.2017 / 20:42
1
answer

Filter data from a string with regular expression [duplicate]

I have a variable that contains the full name of the company and the CNPJ. I'm using verificaCnpj = re.search("\d{2}.\d{3}.\d{3}/\d{4}-\d{2}", variavel) to locate the CNPJ (because there are other variables that DO NOT CONTAIN CNPJ, and t...
asked by 07.08.2017 / 16:34
1
answer

Delete blank lines

I have text that has a structure like this: AJUSTE_ESTOQUE AJUSTE_PRODUCAO AJUSTE_QUALIDADE AMOSTRA I've made a regex ( ^\s*$ ) to find these blank lines, how can I remove them so that each word is underneath the other? I'm...
asked by 11.04.2017 / 13:45
2
answers

Regular expression to deny everything other than social reason

I'm trying to create a regular expression to remove everything that is not part of the business name in a string, but I'm having trouble not removing the symbols that are in the middle of it. Entry: 201700000000111 01/02/2017 11.111.111/000...
asked by 17.04.2017 / 17:34
2
answers

Removing replaceAll ("[() .- \"] ")

I'm using openJDK1.7 , I'm in need of help. String[] vetor = {"\"Jui.ce \"", "j-90.0", "Abobr.e-u"}; for(int = 0; i < vetor.length; i++) vetor[i].replaceAll("[()-.\"]", ""); The above code among others is not giving a problem b...
asked by 26.01.2017 / 23:24
1
answer

Problem parsing regular expressions of a jTextArea

I'm trying to parse text typed in a jTextArea, in the form of an algorithm in English. Initially I must recognize the main method, which is characterized by "beginning" and "end." The way I'm doing (code below), my logic only works if everything...
asked by 31.10.2016 / 19:34
1
answer

Break lines with regex

I'm having a problem separating lines from multiple txt files. These files have a specific pattern but there are files that do not respect it. Here are some of the 5000 files I'm trying to read: SAMPLE TYPE / MEDICAL SPECIALTY:Dentistry...
asked by 15.11.2016 / 00:42
1
answer

Regex for number format

How can I create a regex (which will be used with preg_match ) for the following format 1.123,12 ?     
asked by 27.06.2016 / 18:05