Questions tagged as 'regex'

1
answer

Apache mod_rewrite

I have a rewrite rule I found in a old question of the American OS: RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^(.*/)([^/]+)/([^/]+) $1?$2=$3&%1 [L] RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^([^/]+)/ $1.php?%1 [L] This rule...
asked by 19.10.2016 / 19:24
2
answers

Validate domain preg_replace

My question is as follows, I have the following function: $site = preg_replace("/[^a-zA-Z0-9]/", "", $_POST['site']); But when using the string www.lostscavenge.com , this regular expression issues the following return:   wwwlostscavenge...
asked by 15.01.2017 / 23:48
3
answers

Extract numbers from a list using Regex

I have the following list <type 'list'>: [u'1',u'2'',u'3',u'4',u'7'] The result I hope is: 1 2 3 4 7 I tried to use re.findall(r'\d+', variavel) But it does not work, note that I also need     
asked by 17.09.2016 / 16:21
2
answers

Regex: Open and close with the same character and allow more than one type

You can get text between two characters that are equal, with the following conditions: The opening character should be the same as the closing character. Allow more than one character type at opening / closing. Simple example: /("...
asked by 16.04.2017 / 03:10
2
answers

check email in jquery as if it were two string

Good evening, I'm finalizing a form check and I caught it at one point, maybe because of the way they wrote my work code I can not use jquery validate , so I have trouble verifying that a input field has an e -mail typed. I made...
asked by 17.04.2017 / 01:08
1
answer

Validate increasing and decreasing numbers with regex

I need to create a regex for validating increasing and decreasing numbers as the example:    Repeated | growing | Decreasing   000000 | 012345 | 987654   111111 | 123456 | 543210   [09:30:16] William Oliveira: Repeat validation is in r...
asked by 26.07.2016 / 19:02
2
answers

Treat all hexadecimal colors in a .css file using php and regex

I do not know if they can help me but I want to replace the color in "#xxxxxx" format in a CSS through Regular Expression and PHP. I have a function that calculates the color and replaces it with the inverse color. I need to get the CSS and i...
asked by 24.12.2016 / 03:44
1
answer

How to indicate in a regex that the '(' and ')' symbols, the parentheses, are one of the alternatives in a list of symbols in Java?

I'm developing code that captures text using regular expressions (regex). This text is made up of parentheses. The point is that parentheses are used in regular expressions as group definers and I want to use them as literals. I have alrea...
asked by 21.12.2016 / 03:06
1
answer

Regex does not work in chrome

I have the following script in which I use a jquery to validate a regular expression that filters the names of the files to upload: $(document).on('change', "input[type='file']", function() { var validaFile = $("input[type='file']").v...
asked by 02.12.2015 / 17:52
2
answers

Use the number of characters obtained in a regular expression sentence in the string substitution

I'm doing a Markdown parser as part of a regular expression study, and I'd like to use the amount of characters in a stretch of the expression as a basis for string substitution, for example: # Titulo ## Titulo The first title will be added...
asked by 20.08.2015 / 19:38