Questions tagged as 'regex'

2
answers

Regex that validates only normal and leap years in C ++

I was trying to validate leap years using regex in C ++. If the user types 28/02/1900 , it would return valid. But if the same type 29/02/1900 , it would return error. Searching, I found this regex that compiled but is not vali...
asked by 10.10.2017 / 23:27
3
answers

Regex returns False when validating board

I'm trying to validate a car plate in the format: ABC1234 3 Letters and 4 numbers. let regex = new RegExp("/[a-zA-Z]{3}[0-9]{4}/"); let isvalid = regex.test('abc1234'); When I post to other sites, they recognize the word, but the above code...
asked by 07.01.2018 / 22:14
2
answers

How to select text between spaces - REGEX?

I have a string like that of names: var names = ' GEO X GEO3 X GEO4 X'; and I need to do a split using regex to separate only those texts that are between spaces and not X in the arrays I tried: console.log(names); var re = /(^\s...
asked by 18.04.2018 / 22:18
3
answers

JavaScript Regular Expression for Phone with DDI

I'm having difficulty understanding Regex logic, and I do not think codes that make up the complete phone mask with DDI, DDD, and 8- and 9-digit phones with hyphen changes when typing right in the field using for example the onkeyup event . F...
asked by 10.03.2017 / 17:55
3
answers

PHP remove an excerpt from the URI with regular expression

I have the following uri $uri = "http://www.meudominio.com.br/pagina.php?campo=teste&ordem=2&cor=azul" How to remove "ordem=2 "from the url above with regular expression, knowing that the value of the order, time can be 2, 3,...
asked by 17.10.2016 / 23:04
2
answers

Regular Expressions C ++

I have text with the following formatting    concept: personasia: toby_pizur: personasia: test How do I get a string with this formatting, only the text after the last colon (:)? In the example above, I would only have "test".     
asked by 04.04.2018 / 21:06
3
answers

exchange char Z for S between vowels in a string

How can I change all occurrences of the letter Z between S within a string for example    TEREZA, CEZAR, BRAZIL, ANZOL would be    TERESA, CESAR, BRAZIL, ANZOL     
asked by 11.08.2016 / 17:09
3
answers

Where is the error in replace js?

t = "(10px,10px)" t = t.replace(/-|\d+/g,3,5) I wanted it to result in (3px, 5px) Where is the error?     
asked by 20.02.2018 / 15:41
2
answers

Regular expression to find numbers in the middle of words

I'm currently developing a project that I'm using regular expressions to find certain patterns, however there is a specific String and I need to extract two numbers from this, the expression is like this: Agência: 0000 Conta: 00000-0...
asked by 27.02.2018 / 19:28
6
answers

BBCode Parser ignore what's inside [code]

I made a bbcode parser based on some to meet my needs, however I have some problems. The code inside [code] should be ignored, but I do not know how I could do this, since it has all the other tags that are parsed. I tried to do this, did...
asked by 11.08.2014 / 17:42