Questions tagged as 'regex'

1
answer

How to construct the regular expression for the case?

I need to create an expression for the following case of a code field: Maximum number of characters The first digit should be just numbers [0-9] The code is composed of alphanumeric digits and only the / (bar) and - (hyphen) characters,...
asked by 23.10.2015 / 19:10
3
answers

Blank space in Regular Expression

With the following regular expression (^ DOC) * [0-9] I can capture all the numbers after the "DOC" sequence. However, by testing in this text: TEXT TEXT TEXT TEXT DOCUMENT: 240010 9/24/2014 It returns me "24001024092014", the date com...
asked by 26.09.2014 / 16:09
1
answer

Delete letters before after a number

Hello, I have a String ( var test ), and I'd like to do some operations on it. The desired result is a number, preceded or of the letter p or ps ) (ex s ) : ps1), and a number, followed by any letter az , in any quantity,...
asked by 18.03.2015 / 05:33
3
answers

Put in array strings according to a regular expression

I would like to make an array containing strings in this format: [Texto com acento espaço e números 99] Example, if I have this string: var texto = "Eu quero comprar [qtdOvos] e [qtdFrutas] somando o total de [totalCompras]"; I need to...
asked by 30.01.2015 / 21:03
1
answer

indexOf with regular expression using variable [duplicate]

I use indexOf to check if a string contains a given text. But this is case sensitive and also sensitive to accents. Would there be any way for me to find these records in the case of entering any of the following in the search: joao J...
asked by 26.03.2015 / 20:47
1
answer

Apply mascara to the Java backend

Does anyone know how to include a mask from a regex in a string? For example, I have the following regex String pattern = "\d{2}[/]\d{3}.\d{3}[/]\d{4}"; and a variable with the following String numeroProcesso = "010000012018"; valu...
asked by 13.08.2018 / 21:00
2
answers

Regex - Expression to paste limited fields

I have the following string: "Let's put some bits in your home" Using regular expression, how could I just get information from bits forward, getting: bits in your home That is, the other words are discarded. Has anyone seen...
asked by 15.05.2018 / 21:10
1
answer

Regex for repeated numbers in the CNPJ

I have the following regular expression: regex:/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/ I can validate for this, but not for repeated numbers. I want to apply within this regex, a form that does not accept repeated values, for example:...
asked by 01.11.2018 / 14:11
1
answer

Change Javascript string characters to successors

I have a string, for example, acbd and I want to get another string bdce , formed by the successors of each character. In my searches, find a possible way to transform the string into an array and then iterate it to get a new string....
asked by 05.01.2018 / 19:43
3
answers

Regular Expression - Name + Space + Last Name

Hello, I'm looking for a regular expression to validate name and surname mandatory. But it should accept accents and a specific case that would be: Igor D'Sant     
asked by 11.12.2017 / 19:35