Questions tagged as 'regex'

1
answer

Why is my variable null?

I'm translating a function from Java to JS, the logic remains the same but the results are different. On regular expression test , returns match when testo 40kb but when compiling the code gets a null on an unspecified line. Why whe...
asked by 27.04.2015 / 14:52
1
answer

How to get only a part of a string from a pattern?

I have a string in Lua language. I want to get only the filename part through match ( 403.htm.en ). Example: var=[[Content-Disposition: attachment; filename="403.htm.en" Content-Type: text/plain; name='403.htm.en'...
asked by 30.07.2015 / 18:59
2
answers

preg_replace with Regex to add a tag

Does anyone know how to do regex select the phrase and add a tag? <li> <p>b) texto muito longo;</p> </li> $FechasemClassAlinea = '<p>[a-z])_.*</p>\n</li>$'; $FechacomClassAlinea = '<p>...
asked by 03.05.2015 / 18:58
1
answer

Why does not my regEx work as expected?

I really have difficulty setting up regular expressions, mainly for varying their behavior in each language. I'm translating a Java code into JS, in which the regular expression is /(\d{1,4}|\*)\s*[xX]\s*(\d{1,4}|\*)/ , so I understand it...
asked by 30.04.2015 / 13:46
2
answers

Doubt about a regular Javascript-specific expression

Using a regular expression (regex), I would like to know how to do a validation that allows such conditions:    0-9 / * - + () root pi But besides allowing numbers and characters, I would like the expression to allow specific words too .....
asked by 16.07.2015 / 18:25
2
answers

Problem in regular expression in .htaccess

I have the following rules in my file .htaccess : RewriteRule ^first-login/([a-zA-Z0-9]+)$ ./first-login.php?userKey=$1&step=1 RewriteRule ^first-login/([a-zA-Z0-9]+)?([0-9]+)$ ./first-login.php?userKey=$1&step=2 The first one...
asked by 21.04.2015 / 00:10
2
answers

How to create validation with special characters

I would like to know how to create a validation with preg_macth() where you have to accept these keyboard characters: /^([a-zA-Z0-9]{6,40})$/ '~!@#$%^&*()_-+={}[]\|:;"'<>,.?/ Less spaces.     
asked by 14.03.2015 / 16:05
1
answer

Using KeyPress event with Regex

I'm doing a C # application on Windows Form using .Net Framework 3.5 . In this application I have a textbox for the entry of CPF or CNPJ. I need this field to have only numbers and CPF / CNPJ characters (./-). I would like to validate...
asked by 10.06.2014 / 20:47
1
answer

How to find exact RegExp and do this using constructor syntax?

I have an algorithm that takes multiple full paths of files and verifies that each of them is 'banned' by the server. The var s of for refers to each of these paths and sets is an array with regular expressions to check....
asked by 15.01.2015 / 23:53
2
answers

Filter string field snippet in MySQL

I'm having difficulty getting only the zip code of a field in which the address data is not atomic, I'd like to know a way using MySQL to get only the 8 numeric values of the ZIP code from the field of all records in the database which contain 8...
asked by 07.05.2014 / 03:15