Questions tagged as 'regex'

1
answer

Doubt on regex

Have this string and need to scroll through it by taking only the values that are within () . The string is: String estados = “(1, ‘AC', ‘Acre’), (2,’AL', ‘Alagoas’), (3, AM, ‘Amazonas’)… “ I've mounted the following regex : Patt...
asked by 07.10.2016 / 16:00
1
answer

Backslash in Regular Expression

I was studying java and the course instructor left me a challenge to validate an email using regular expressions. I researched the regex API documentation ... part of the pattern .. The problem is that I found a code on the internet (which wo...
asked by 29.01.2018 / 01:29
1
answer

replace with regular expression (regex) ignoring accents

Recently I changed the friendly url, due to this the querystryng used for searches was filtered without accents. Regarding queries to the database independent of the word having accent or not being found. But I used to give a replace to highligh...
asked by 24.12.2015 / 12:42
1
answer

Replace string by keeping the box (uppercase / lowercase)

What is the best way to replace a pattern with a string while holding the box? For example, DAdo - > LAdo or dado - > lado .     
asked by 05.02.2016 / 00:18
2
answers

Format CPF column with regular expression

In a table containing the CPF column I would like to format it to display the content appropriately. By proper means I mean the format 999.999.999-99 . Is it possible to format this content using regular expression? SQLFiddle for testing...
asked by 27.07.2015 / 19:57
1
answer

Regular expression, picking up numbers before a text

I wanted a regular expression to pick up the minutes in a string with this format: 1 min 10 min I made that expression. \d(?= min) The problem is that it only takes the last number, the closest to the min. How would I get all th...
asked by 01.09.2015 / 19:57
2
answers

replace using regular expressions

I'm running a regular replace tag to format a string, such as the CPF: var cpf = '99999999999'; cpfFormatado = cpf.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, '$1.$2.$3-$+'); console.log(cpfFormatado); // 999.999.999-99 I'm trying to reduce the...
asked by 26.03.2015 / 19:43
1
answer

How to create expression to allow only a few characters?

I am creating an input where an onKeyUp checks the entered characters, it should validate the following: Maximum number of characters The first digit should be just numbers [0-9] The code is composed of alphanumeric digits and only the /...
asked by 23.10.2015 / 19:58
3
answers

Picking indentation with Regular Expression

I would like someone to help me create an ER that takes only one mark and all the lines that are indented forward. example: aaa abab aca marcacao aaa abab aca cc cc bb With the above code ER would return: marcacao aaa ab...
asked by 30.08.2014 / 02:33
1
answer

Regular expression that accepts letters, numbers, and underline

How do I get the ER below to accept letters, numbers, and underline, and continue not allowing other characters? preg_match('/[^a-z\d]/', $_POST['login'])     
asked by 21.08.2018 / 03:14