Questions tagged as 'regex'

1
answer

Getting text into another text

I want to get a List(Of String) of text blocks, however there is a problem: { --isso é um bloco; echo "Aqui tem um } no meio";} And I would like to get this: --isso é um bloco; echo "Aqui tem um } no meio"; but it's coming bac...
asked by 16.06.2015 / 00:22
1
answer

Uncaught SyntaxError: Unexpected token var

I'm doing a simple test with RegExp in JSFiddle and I do not understand why    Uncaught SyntaxError: Unexpected token var See: link Code: <input type="text" id="entrada"></input> <button id="botao">Testar</butt...
asked by 18.06.2014 / 15:02
1
answer

Regex special characters required

I need to create a regex to validate password. It must contain at least 8 characters, which must have at least 1 letter, 1 number and 1 special character.     
asked by 01.12.2018 / 01:20
1
answer

How to replace a certain string sentence in Python? Using re.sub ()

I would like to replace every expression that starts with the characters: *: . tentativa = 'Olá td bem? *:palavra_proibida*985 td otimo' resultado = re.sub('*:', '', tentativa) Result Obtained: Olá td bem? palavra_proibida*985 td ot...
asked by 03.09.2018 / 23:18
1
answer

Detecting URL in Textarea with Regex

Expensive, I would like to use the following example ( link ) that marks any link entered, and put in a textarea of my site to mark and warn that no links allowed. I tried with required pattern and could not. I also did the following example b...
asked by 14.08.2018 / 14:43
1
answer

Error escaping a url in js express from a middleware

I have a problem escaping a Url validation of Token . I am using lib jwt (jsonwebtoken) to restrict the access to request of my api, however I want to leave url /imagem/:parametro without validation by token. Because today when I...
asked by 01.11.2018 / 20:59
2
answers

Replace list with pattern in regex

Personally I need to transform a string into a list, in a peculiar way. I found in this post what I need to do. But I'm lost to the applied regex. I have numerous string in the following format: ["DECRETO Nº 76.326 DE 23 DE SETEMBRO D...
asked by 08.07.2018 / 20:56
1
answer

Dynamic friendly URL .htaccess

I currently have the following rule in .htaccess: RewriteRule ^fale-conosco/?$ view/fale_conosco.php [NC,L] And I'd like you to be able to enter a friendly URL after you contact us /. Example: fale-conosco/ajuda For t...
asked by 15.08.2018 / 21:52
1
answer

REGEX to remove sites, emails [closed]

I want to remove the addresses of sites, emails, etc ... url_regex = re.compile(r'(?i)(<|\[)?(https?|www)?(.*)?\.(.*){2,4}') mail_regex = re.compile(r'(?i)(<|\[)?@(.*)\.(.*){2,3}') In this way, I could remove for example:    link...
asked by 11.07.2018 / 15:59
1
answer

REGEX - Allow HTML at the beginning of the string

This expression is cutting the HTML only when I put it at the beginning of the expression. How to fix this? (?:[ \t]*[a-z][)]\s*)?([^\r\n<]+(?:(?:\r?\n(?!\s*[a-z][)])|<(?!br\s*\/?>(?:\s*<br\s*\/?>)*\s*(?:\s+[a-z][)]|\s*$)))[^\r\...
asked by 25.05.2018 / 15:39