Questions tagged as 'regex'

1
answer

Regex to validate national document number

I'm trying to create a national document validator that accepts numbers and letters or just an 11-character JavaScript limit number. The problem is with regex creation. Follow the code: var documento = 'abc123-$/'; alert(documento.replac...
asked by 17.10.2018 / 11:05
3
answers

How to only allow numbers and hyphens with preg_replace?

I'm having a question regarding preg_replace , I'd like to know how I could do to only allow numbers, and hyphens ( - ). My code is as follows: $ola = preg_replace('/[^[:alnum:]_]/', '',$_POST['ola']); How can I do just numbe...
asked by 17.02.2017 / 21:00
3
answers

Regex to validate a particular date format

I was modifying a regex for a program in c ++ that would validate the following input form of the 29/feb/2000 dates. Currently it was only accepting 29/02/2000 or 30/03/2017 . I tried to add to the other months but I can n...
asked by 29.01.2018 / 11:47
1
answer

Separate one paragraph for sentences

I need to break a paragraph in a set of sentences. For example: var paragrafo = "Sou Dr. José. Meu passatempo é assistir séries. Adoro animais!! E você?"; var frases = paragrafo.split('.') But he ends up breaking the word Dr. too: var...
asked by 05.02.2018 / 16:18
1
answer

Arrows do not move in text field with regex [closed]

I have the following code with a regular expression inside a Keyreleased method, which allows only a few characters to be entered by the user into a text field: String text = input.getText(); text = text.replaceAll("[^A-Za-z&\|!]",...
asked by 31.10.2017 / 23:57
4
answers

Make a regex to remove characters

In a return of a jquery function, the returned date comes in this format. /Date(1401731794773)/ I would like to remove the invalid characters on this date, which are: /Date( and )/ I only need the date (remaining) compon...
asked by 16.06.2014 / 18:29
2
answers

Regex to get text into python?

I would like to extract the text contained between < > of a string. At first, I built the following expression: import re m=re.search(r'<(.*)>','abevbv envvrhwkv <eiwbv> ebvi <wieunv> ajhbsvhj') The expression would...
asked by 30.04.2017 / 19:10
1
answer

How to validate Date with Regex?

I'm trying to catch a date inside a string using regex, but when I try to retrieve the part of the string it returns me the following error:    parsing "\ RATE: ([\ d /] +)" - Unrecognized escape sequence   \ T. match = Regex.Match(sbDado...
asked by 13.06.2016 / 23:04
3
answers

Regex verify IP

I am implementing a regex to accept IP address, for this I am using a mask in the textEdit component of DevExpress, but when I leave the field blank or with only a filled part it locks all other controls of the form. Regex used: ([0-9]{1,3}\...
asked by 01.02.2017 / 12:55
2
answers

How would a regular expression find a html + attribute value?

I want to give a find / replace on all the html "data-placeholder" attributes and their values, from my application, through the Visual Studio search. For this I need to put together a regular expression and put it straight into the Visual St...
asked by 22.01.2016 / 18:49