Most voted "regex" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to regular expressions. Regular expressions (usually abbreviated as "Regex", "regex" or "regexp") are a declarative language used for matching patterns within strings. When asking, also include a tag specifying the programming language or tool you are using to identify one of the different dialects.
Learn more…1,253 questions
Sort by count of
-
0
votes2
answers1526
viewsIgnore any white space in the middle of a string
I am trying to create a regex that is able to find a string in a text even if there is some white space in the middle of the words. For example, I look in the text for the following excerpts…
-
0
votes1
answer849
viewsHow to load data from an XML file into an HTML input field?
I’m trying to upload an XML by uploading it to an object and showing it on the screen. I managed to do it in a Div But I’m not getting to show in Inputs. Follow the process and the code: I choose…
-
0
votes1
answer359
viewsRegex - Remove between tag and class name start and last tag close
I have a string (html) and need to remove everything that is between the first occurrence of <div class="c and first tag closure > and last closure of "</div>". The first, it must be…
-
0
votes1
answer83
viewsRegular expression that returns next words
Well I’m working on a regular expression that picks up license plates, my interest would be not just picking up the license plates, but like things next to it, for example: |Placa:AVX-4300 Fiat Uno…
-
0
votes1
answer254
viewsI need to go through the data of several txt, take specific data and generate a csv
I’m already going through the files and accessing the data, but I need to get what’s after the following line: P.A.C.() initial P.A.C. () Sopave of the quota due 3a. installment due due due payment…
-
0
votes1
answer216
viewspreg_match_all, regular expression in php with variables
Hello I’m having difficulties in mounting the regular expression, and the function returns me 3 positions in the array all empty; preg_match_all('/<a data-role\="sku\"…
-
0
votes1
answer277
viewsPreg_match c/ Regular expression
I need to remove everything around the link below. I’m using preg_match with regular expression, and as I’m new in the area, I’m having a hard time finding my mistake. Would you please help me? Like…
-
0
votes1
answer308
viewsFilter object array by key
At the moment it is only returning if the string to be queried is exactly equal to the key of the object let estilos = { "alignContent": [ { "ativo": false } ], "alignItems": [ { "ativo": false } ],…
-
0
votes1
answer143
viewsRegular Expressions in python
How can I read a python file looking for words that fit into a regular expression, for example: search dates(dd/mm/yyyy)?
-
0
votes2
answers439
viewsREGEX - denying prepositions in the name of public places
I could use some help in a regex. I need to beat streets at the base of the post office, but because of the prepositions many streets are not found. Example: Input file = STREET BEACH OF ARMACAO…
-
0
votes1
answer322
viewsHow to validate valid characters for latitude and longitude during typing?
I have a text input for typing latitude and another for longitude. I would like the field to allow typing only of characters valid for latitude and longitude. I believe the field should accept only…
-
0
votes2
answers829
viewsHow to pick only numbers between parentheses in Python with regular expression
Texto = "54 oz (163 g)" I want the result to be only 163
-
0
votes2
answers140
viewsValidate a string with Regex
I need to validate the name of a file that has the following name NWD[0-9] PADRAO -. The literal part will always be the same, what may vary are the numbers. I’d like to know how to do that with…
-
0
votes1
answer83
viewsHow can I do this more intelligently and without conflict?
In this way, it is returning some errors and it seems that it may present conflicts in the cases of 2-character operators. Example: "++" being replaced by "#++#" while the next replaceAll() it will…
-
0
votes1
answer436
viewsSearch for part of string in php?
How to do : db.getCollection('Collection').find({“field”: /.*A.*/}) using PHP Mongodb BSON Regex?
-
0
votes3
answers83
viewsHow to capture only a specific part of a string?
Using regular expression, I would like to capture only the value within a tag: <txt_conarq_assunto></txt_conarq_assunto> Example: Entree: <txt_conarq_assunto>A…
regexasked 6 years, 6 months ago Lucas Vinícius 43 -
0
votes1
answer117
viewsHow to pick up part of the string from the size of a word?
I want to take only the name of the discipline of an H1 containing the following text: "ENF N1A METHODOLOGY OF SCIENTIFIC RESEARCH (MES)". In this case what interests me in this string is the value…
-
0
votes1
answer96
viewsHow to select an image link text (html) and delete everything else with Regex?
I am working with a CSV file (XML type), I am using a google spreadsheet to be able to clean the data, I would like to edit a set of cells making a selection of an image link in html and delete the…
-
0
votes2
answers105
viewsHow to create regex that only accepts characters without accents
On my form html, I have the "name" field. In this field, I want to allow the field to accept only characters without accents. How to do this validation using Regex? I don’t want a function, I want…
-
0
votes1
answer824
viewsHow to create a CONSTRAINT CHECK in Sqlserver to validate versions with Regex
Hello I am creating a table in Sqlserver where I want to validate a field to only accept the correct version mask, like this: CREATE TABLE Versao ( id INT NOT NULL IDENTITY(1,1), codigo…
-
0
votes2
answers623
viewsRegular expression for dynamic URL
I have an html file with urls in this URL pattern: https://www.olympikus.com.br/tenis-olympikus-flower-415-feminino-cinza-D22-1131-010 The standard is protocolo://dominio/strig-dinâmica-000-0000-000…
-
0
votes1
answer79
viewsREGEX - Allow HTML at the beginning of the string
This expression is cutting HTML only when I put it at the beginning of the expression. How to fix this? (?:[…
-
0
votes2
answers910
viewsCatch DDD nos (11) with regex
I need to get the DDD that’s between the paretenses: (11) 9.9999-9999 I tried to make a regex but I was not successful. I will use PHP to get it, but I needed a regex for it. Could someone give me a…
-
0
votes1
answer185
viewsRegular expression capturing every line
I need an expression to intercept all the content of a line, starting with a specific word and going to the break of the line. Everything can happen here, I need you to identify everything without…
regexasked 6 years, 5 months ago Renatta Santos 9 -
0
votes0
answers48
viewsHow to search for generic text/phrases of a certain language?
I have a hundred ". jade" files that contain several static phrases in Spanish. I want to map and exchange these phrases for dynamic content based only on the type of language (since I don’t have a…
-
0
votes2
answers217
viewsDefault list replacement in regex
People need to turn a string into a list, in a peculiar way. I found in this post what I need to do. But I’m lost on the regex applied. I have numerous string in the following format: ["DECRETO Nº…
-
0
votes1
answer264
viewsREGEX to remove websites, emails
I want to remove website addresses, emails, etc... url_regex = re.compile(r'(?i)(<|\[)?(https?|www)?(.*)?\.(.*){2,4}') mail_regex = re.compile(r'(?i)(<|\[)?@(.*)\.(.*){2,3}') This way I could…
-
0
votes2
answers225
viewsHow to use preg_match() to catch a link within a Javascript code
Hello, I’m making one file_get_contents() in PHP and getting a JS, in this javascript has a code where it contains: $("#download-botao").attr("href", "link.com"); I’m wanting to get this link.com in…
-
0
votes1
answer222
viewsRemove WWW and HTTP / HTTPS with regular expression
Hello, I am making a script that inserts values inside a finance system, but when you insert with http 'www' 'https' it is an error and I have to remove in hand. So I want to put a regular…
regexasked 6 years, 3 months ago Leticia Fatima 255 -
0
votes1
answer256
viewsDynamic friendly URL . htaccess
I currently have the following rule in . htaccess: RewriteRule ^fale-conosco/?$ view/fale_conosco.php [NC,L] And I would like it to be possible to inform a friendly URL after contacting us/.…
-
0
votes1
answer77
viewsDetecting URL in Textarea with Regex
Dear, I would like to use the following example (https://www.regextester.com/96504) that marks any link typed, and place in a textarea of my website to mark and warn that links are not allowed. I…
-
0
votes1
answer63
viewsHow to import files using REGEX?
Good afternoon Everybody, all right? I have a question in regex in python. I want to create a script to open files without informing its format may be pdf, txt, jpg, png, among others... However, I…
-
0
votes1
answer272
viewsHow to replace a certain sentence of a Python string? Using re.sub()
I would like to replace every expression that starts with characters: *:. tentativa = 'Olá td bem? *:palavra_proibida*985 td otimo' resultado = re.sub('*:', '', tentativa) Result Obtained: Olá td…
-
0
votes1
answer129
viewspreg_match returning 0
Good afternoon, I have a string I get from the database <!DOCTYPE html> <html> <head> </head> <body> <div> </div> <div> </div> <div>…
-
0
votes1
answer73
viewsHow to delete variables defined in the Header Manager in a given HTTP request (JMETER)
Could someone help? I would like to delete a certain parameter (variable) entered in the HTTP Header Manager in just one HTTP Request. Thanks in advance!
-
0
votes2
answers69
viewsString containing only numbers
I need a regular expression for a string to receive only numbers, for example: "12454853", "12", "9012" These are valid, but I need when a string like: "123g123", "123er*" He calls it invalid.…
-
0
votes1
answer49
viewsUnderstanding Regex test on MDN
Hello, searching on Regular Expression, I got a link to the MDN: [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test, But I looked, I looked and I…
-
0
votes1
answer110
viewsRegex words in lowercase
I have a Regex that removes characters that are not letters or space for a Python application. Ex: var = re.sub('[^a-zA-Z \\\]', '', "abc Abc aBC cde123 def-ghi $?!123") Is returning: abc Abc aBC…
-
0
votes1
answer70
viewsError while escaping an express js url from a middleware
I’m having a problem escaping a Url of the validation of Token. I’m using the lib jwt (jsonwebtoken) to restrict accesses to my api request, but I want to leave the url /imagem/:parametro without…
-
0
votes2
answers7370
viewsRegex special characters required
I need to create a regex to validate password. It must contain at least 8 characters, of which it must have at least 1 letter, 1 number and 1 special character.
-
0
votes1
answer94
viewsRegular expression for wildcard word collection
I am stuck in the following situation: I have a dictionary of words in a mongodb bank, where each word is stored in a document, which has other additional information about it. I need a regular…
-
0
votes2
answers382
viewsRegular expression that finds patterns in which some terms can change?
I need to find a pattern within a text. Example: PROJETO Nº 1.100 DE 28 DE DEZEMBRO DE 2018. Within this pattern, the word PROJETOS may also be PROTOCOLOS and the character º can be o. Thus, the…
-
0
votes1
answer37
viewsRegular expression to get the third part of a paragraph in HTML
I created this regex and apparently it’s almost the way I’d like, however, I’d like to insert the tag <img> after the third occurrence of a sequence of paragraphs. As I did is inserting the…
regexasked 5 years, 11 months ago user1757965 3 -
0
votes1
answer141
viewsRegex to extract HTML information
I am trying to extract information that comes from reading email. However when you pass the match line, it pops the following error: {"analyzing "(?si:(Information Type[ d]+(?[ d]+)|Information…
-
0
votes1
answer78
viewsHow to find a text inside a file with Regular Expression
Good morning I need to create a script to normalize some DFM type files (Delphi form file) where I need to change the expression Commandtext to SQL.Text and whatever you have after = stay () object…
-
0
votes1
answer82
viewsCapture multiple links addresses with Regex in PHP
I’m using the function file_get_contents() on a page that returns multiple links addresses in the body: #EXTINF:-1…
-
0
votes1
answer1825
viewsSecure PHP password (Password verification)
How do I check if my password is secure or not? I have a code in PHP checking, but I don’t know how to do it password check. She should be: Have more than 6 characters (Made in HTML); Contain upper…
-
0
votes3
answers3126
viewsMercosul standard vehicle plate?
I’m working on a project and I don’t know how to do it. As in the statement, I need to validate the plates with the Mercosul standard, I have a method to validate the old plates of vehicles. public…
-
0
votes0
answers46
viewsORACLE : Select Rows Where First, Last or Both Characters are Special or Punctuation, excluding Dot '.' if Last
I need to Retrieve Rows from table, in the Column [Client Name]. My request is need to Prevent Names that Start or End with a [:space:] or other special Character [:Punct:], excluding the dot '.' -…
-
0
votes1
answer39
viewsPhp 7.1, How to make a REGEX of the following standard:<div class='inline-render' data-type='credit-card' data-Listing-id='1234'>?
I have a text where the following pattern can repeat many or no times and with different values of data-type: <div class='inline-render' data-type='ALGUM TIPO' data-listing-id='VALOR'> I need…