Questions tagged as 'regex'

2
answers

How to make a regular expression that finds a name and then looks for a character?

I was analyzing an extensive html code that basically contains this format: <span id="mensagem" class="topo">Classes e comandos</span> The problem is that the amount of arguments within span vary in quantity and position The...
asked by 23.08.2017 / 03:10
5
answers

How to make a regex that ignores non-alphanumeric characters?

For example: a regex that finds correpondencia in the string "coin" but that also finds correspondence in the string (m, .o, and d ... a). In other words, it ignores non-alphanumeric characters regardless of position or quantity. NOTE: I CAN...
asked by 14.09.2017 / 18:55
1
answer

Negation operator returns value that should be discarded

When using the negation operator, I want to get only the part of the text that does not contain the previously denied group. Using the expression ( ?<br\/?> ?)(Unit.) , I get the following result : Whenyouaddthenegationoperat...
asked by 16.08.2016 / 20:06
1
answer

Regular Expression Regex

I want to make patterns like this: [a-z]+[acentos] || [a-z]+[acentos]+[espaço]+[a-z]+[acentos] || [a-z]+[acentos]+[-]+[a-z]+[acentos] To be able to register a word, you must be within one of these patterns. For example: téstê || téstê...
asked by 05.10.2016 / 17:24
3
answers

Sed Alternative with PowerShell

On UNIX I would do something like this: sed -n '/início/,/fim/ p' < arquivo.txt On Windows we have PowerShell, how do you do it with it?     
asked by 04.05.2016 / 20:52
1
answer

How to make a regex that accepts one line but not two?

I get lost while doing any complex regex. I use the following code in java: Pattern pattern = Pattern.compile("tentativas de regex aki"); Matcher matcher = pattern.matcher(conteudo); while(matcher.find()) { System.out.println(matcher.gro...
asked by 16.02.2016 / 01:17
1
answer

Verifying browser and version with REGEX

I'm working on a vb.net MVC system and need to detect the browser and version. I'll only use Chrome, and IE9 +. I would like to know if I can simplify the verification structure using Regex. Below is the excerpt that I use to do the verifi...
asked by 06.01.2016 / 16:50
4
answers

How to search for results in MySQL where a particular field has only special characters?

I need to search in MySQL, lines where a particular field, for example 'Name', is filled with only special characters or spaces. I tried several REGEX for this, but without success. Could anyone help me?     
asked by 07.03.2016 / 19:10
1
answer

Save output after applying a replace

Hello, I have the following code, but I need to apply a replace to output ( FileOutputStream ) I get via http before saving it. public void DownloadFile(String fileURL, String fileName) { new Thread(new R...
asked by 26.07.2015 / 04:29
1
answer

Find the index of an array that matches a regular expression

According to the PHP Manual, the preg_grep function returns the entries of a array that match the regular expression. Example $array = [ 'Banana', 'Maçã', 'Café', 'Biscoito', ]; $array_com_B = preg_grep('/^B/i...
asked by 08.09.2015 / 17:43