Questions tagged as 'regex'

2
answers

Problem with Regex in PHP

I have the following function that is used to take special characters from a string: function removeSpecialChars($string){ //List (Array) of special chars $pattern = array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/","/(í|ì|...
asked by 11.12.2018 / 14:10
2
answers

How to remove repeated characters from a string?

This is my role: let longest = (s1, s2) => { var s1 = 'xyaabbbccccdefww'; var s2 = 'yestheyarehere'; let res2 = s1.concat(s2); console.log(res2); };     
asked by 23.08.2018 / 22:59
2
answers

How to do a regular expression to remove only the hyphen without removing the hyphenated arrow

I have the following expression:    00000-001-> 22222-222 I would like it to look like this:    00000001- > 22222222 I've tried various ways on this site , but I'm not getting it.     
asked by 16.03.2016 / 15:57
2
answers

Only receive money field number

I'm looking for a td with jQuery. var linhaTr = $("tbody").find("tr:first-child"); var tamanhoTd = linhaTr.find("td:nth-child(2)").text(); and it returns me for example R$ 5,00 . But I need to get back to make...
asked by 02.01.2017 / 19:45
2
answers

Regular expression for dates without separator

I have to know if a sequence of 8 numbers is a valid date in the format dd / mm / yyyy. The closest I came to was using this expression: /^[0-3]{1}\d{1}[0-1]{1}[0-9]{1}[1-2]{1}\d{3}$/gm; But it is returning true for sequences that are not v...
asked by 17.03.2015 / 13:15
4
answers

How to get the last segment of the path?

URLs de exemplo: content/edit content/edit/ content/edit?q= content/edit/?q= I tried to make the code but it always fails when the url does not have "/" or "?" and if you have "/?" in the end. The code I made was: .*\/([a-zA-Z0-9]*)[\/\?].*...
asked by 18.09.2017 / 16:25
3
answers

Regular expression that accepts only numbers and / or letters in Java

How to develop a regular expression that allows a string to have only numbers and / or letters in any position and quantities? Examples:    a) 000000000a       b) 000000000A       c) AAAAAAAAA0       d) 1AAAAA1113       e) 1...
asked by 16.07.2014 / 23:05
2
answers

Remove comma out of brackets - Regex

I'm trying to remove the comma that is located outside the brackets of the following excerpt: 2||Azul||Cor||["#1983ff", "#1983ff"],3||Amarelo||Cor||["#fff73d"] I need the return, this way: 2||Azul||Cor||["#1983ff", "#1983ff"]3||Amarelo||C...
asked by 31.10.2016 / 20:10
2
answers

Regular expression

I have a question about how can I make a regular expression to remove phone masks, cpf, cnpj. I was able to remove ("-") from the CEP String[] cepText = edtCep.getText().toString().split("-"); ai in the case of phone has ()#####-####...
asked by 20.12.2016 / 12:07
1
answer

What does this htaccess regex do?

I have this regex: RewriteRule ^www\/login\/?$ login/ [L,NC,R] What does it do?     
asked by 13.07.2017 / 22:51