2015.08.12 22:05 yanni CyberArk
2006.02.28 19:19 spez programming
2009.10.02 17:59 HattoriHanzo Python Education
2023.05.27 19:40 code_hunter_cc Apache mod_alias RedirectMatch everything except specific pattern
2023.05.22 22:01 MikeMichalko Help with pulling multiple values out of one cell in KQL using REGEX
2023.05.18 22:18 J_K_M_A_N Another weird one I am not sure is possible - Trying to get an "Alternate Code" from an order
1 60ea ABC A1234-16-32 Description here 8.88/ea 532.80 Possible Extended Description here - do not need this UPC: 1234567890 2 20ea DEF 866 1562PL Description here 4.44/ea 88.80 UPC: 2234567890 3 10ea GHI 34-12-66-12 Description here 2.22/ea 22.20 Possible extended descriptionThe first number is the line number. I do not care about that. The next is the quantity. I want that. Then is a manufacturer code the customer uses (ABC or DEF or GHI). They are always the same for each manufacturer. After that code is a manufacturer part number. The problem I am running into is, one manufacturer has possible spaces in it (well, a maximum of 1 space) but they always end with PL, CP or EG (some others too but I am simplifying). The other codes COULD end with PL, CP or EG but they may not and they will not have a space. Here is what I have for the items without a space.
^\d+\s(?https://regex101.com/p0gUKY/1\d+?)(?:EARLBX)\s(?:(:ABCDEFGHI) (? .*?) )?(? .*?) (? \d+\.\d+)\/ea \d+\.\d+(?:(?:(?!(?:^\d+\s\d+eaUPC:))(?:.\n))+)?(?:UPC:\s?(? (?!^).*?))?$
2023.05.18 16:33 4bjmc881 Utilizing regex groups correctly in C
#includeI would like to capture the first number from every input, and the algorithm in the brackets at the end. Using the same pattern on regex101 for example, works perfectly fine. But in C, I don't get any match in the first place.#include #include void extract_info(char* input, const char *pattern); char* input1 = "8096 SHA256:RoWJBGWIRLhNM01nNAVtMKN+b6AoKc7IzIBLjESd3Lc [email protected] (RSA)"; char* input2 = "3072 SHA256:3KM6bS6rLN2ErpKZ/q6w9ofPoclxC1NIQas3ngZoR1A no comment (RSA)"; char* input3 = "1024 SHA256:5alMYgak0SlJOljkZCrSYhQbu5RpmsFtv3aSx+2irNU [email protected] (DSA)"; char* input4 = "256 SHA256:lx/aoiwuLcHSmEwk5+gfokM+6BJ1HLPRbAh9ItgDWNs [email protected] (ED25519)"; int main(int argc, char** argv) { char* pattern2 = "^(\\d+)\\s\\S+:\\S+\\s.*\\((\\S+)\\)$"; extract_info(input1, pattern2); return 0; } void extract_info(char* input, const char *pattern) { regex_t regex; regmatch_t match[2]; // Compile regex int rc = regcomp(®ex, pattern, REG_EXTENDED); if (rc != 0) { exit(1); } // Run regex if (regexec(®ex, input, 2, match, 0) == 0) { printf("Match!\n"); // ToDo: Print capture groups } regfree(®ex); }
input1: 8096 and RSA input2: 3072 and RSA input3: 1024 and DSA input4: 256 and ED25519What exactly am I doing wrong?
2023.05.18 12:43 MeIsALaugher Stack or Better: An *Actual* Negative Lookbehind with Boolean OR
2023.05.18 08:03 MeIsALaugher Stumped: Regex Negative Lookbehind With Boolean OR in Automod?
2023.05.11 22:14 BigfootWhiteBoy Regex return all matches
2023.05.10 21:51 chad917 Regextract woes
2023.05.09 17:16 J_K_M_A_N I think I need a negative lookahead here but I cannot figure it out for sure
1 5ea This is the description 12.234/ea 61.17 extended description may or may not be here UPC: 1234567890 2 4ea Description goes here 1.12/ea 4.48 extended description may or may not be here 3 2ea Description goes here 4.10/ea 8.20 extended description may or may not be here UPC: 0987654321I want something like this.
^\d+ (?That works for some (https://regex101.com/qYMWFA/1) but it is a problem if they don't have the UPC part (it basically combines two lines). Is it possible to use a negative lookahead or something to still get the quantity, description and price and just have an empty partnum if they don't have the UPC code listed without combining two lines? I tried this (which of course did not work).\d+?)EA (? .*?) (? \d+\.\d+).*?\d+\.\d+[\s\S]*?UPC: (? .*?)(?:\s$)
^\d+ (?I would appreciate any help, especially to let me know if it is not possible. I don't want to keep pulling my hair out. Thanks.\d+?)EA (? .*?) (? \d+\.\d+).*?\d+\.\d+[\s\S]*?(?!\d+\s\d+)(?:UPC: (? .*?)(?:\s$))?
Quantity Description Price UPC 5 This is the description 12.34 1234567890 4 Description goes here 1.12 2 Description goes here 4.10 0987654321Not sure if it is possible. Also, I do not need the extended description at all but there could be 0, 1 or 2 lines of that before the UPC line (that is the killer part IMO).
2023.05.08 22:55 mulberrymerlangius Variable Search Replace
2023.05.07 09:14 _EggTart_ Regex test website that work with python re.sub?
2023.05.04 23:04 Ethiack Explainer on the REcollapse technique (for zero-interaction takeovers, bypasses for webapp firewalls, and more)
![]() | Hi there. submitted by Ethiack to hacking [link] [comments] Wanted to share a technique we’ve been researching for the past few years. It’s called REcollapse. This technique can be used to perform zero-interaction account takeovers, uncover new bypasses for web application firewalls, and more. This post is mostly based on André’s BSidesLisbon 2022 talk and insights from researching this technique at Ethiack. We’ll explain more about it and how it works. TLDR: you can watch the original talk on Youtube. First, the issue with user inputIt all starts with unexpected input. Modern applications and APIs rely on validation, sanitization, and normalization. This is usually done by custom regular expressions and widely used libraries that validate and transform typical user input formats, such as email addresses, URLs, and more. Like this: Validation (Python) The goal is always about preventing dangerous user input from being stored in the first place. Let’s consider an application that rejects special characters in the name of a user on a /signup endpoint. An attacker can’t inject payloads in the name but this doesn’t necessarily mean that, later on, the name would not be sanitized somewhere, resulting in vulnerabilities, such as XSS. In this case, we can try to find alternative endpoints that are more permissive and accept special characters in the same parameter. On the other hand, normalization is used to make user input consistent. It’s handy for applications with multiple account flows to avoid duplicate email addresses, such as [email protected] vs [email protected] vs á@ª.com and so on. The normalization libraries have different outputs, as you can see in these examples, which can be helpful to detect technologies used by the backend. What’s the problem?Regex is usually reused from StackOverflow, Github, or other sources. Developers typically don’t test them properly and sometimes paste different regular expressions across backend endpoints. For instance, the aforementioned regex "^\S+@\S+\.\S+$" doesn’t work well for proper email validation: regex101.com Things also get interesting with GitHub Copilot. Generating code to validate if an URL is part of a whitelisted domain gives the following result in Python: Code Generation with Copilot Fuzzing this regex with the REcollapse tool presented bellow gives an input https://example՟com that will be accepted for example.com as the domain argument, but it’s translated to xn--examplecom-ehl (punycode), allowing an attacker to bypass the validation, as an example. In terms of normalization, confusion and duplicate states can sometimes be reached if normalization is not used consistently in all endpoints and flows. In addition, the core regex libraries of different programming languages can have slight differences while processing the same regular expression. Using the REcollapse techniqueSo, how to bypass the current validation or sanitization? Also, how can we leverage user input transformations? Fuzz the parameters in a smart way.Consider the following scenario: https://example.com/redirect?url=https://legit.example.com ✅ https://example.com/redirect?url=https://evil.com ❌ We can’t redirect to an attacker-controlled URL at first glance. Trying a bunch of payloads also doesn’t work. What can we do?
https://preview.redd.it/fvlrogoppvxa1.png?width=1600&format=png&auto=webp&s=970d93f841b4095f76ba21a785da6f0609d1c1fc https://preview.redd.it/ka55lgoppvxa1.png?width=1600&format=png&auto=webp&s=5bc3bf726e9280e119e4b64e0a7d7dbc2c0bc94c 2) Fuzz positions with all possible bytes %00 to %ff. Here you can see more examples: https://preview.redd.it/gngl3z7tpvxa1.png?width=1445&format=png&auto=webp&s=764a287443099c8fd2db992cb63b22d59482b7f7 3) Analyze the results: sort by response codes or response length. And that’s it. André built a tool for this, in case you want to try it out. Github repo here: https://github.com/0xacb/recollapse |
2023.05.04 15:26 Pb_Blimp Is it possible to match a newline with egrep?
tail -FAs you can see, I have 10 different patterns I egrep for.egrep "HandoverPreparationUEContextSetupRequestUEContextReleaseCompletephysCellIdmeasResult.+CellMeasurementReport\\sRRCReconfiguration^\\s*rsrp\\s[0-9]+measResults.*$.*measId\\s[0-9]"
.*measId\\s\[0-9]This turns up more than I care to see. Here is an example of when I want to see it...
measResults.*$Ultimately I would like to combine the last two patterns in my egrep, but cannot figure out for the life of me how to get it to work in linux with my other egrep patterns². I can get it to work in regex101.com, but not in linux.
grep -zoP "measResults.*\\n.*measId\\s\\d"I believe that is everything. Please let me know if you have any suggestions or questions.
2023.05.04 09:58 G0nz0uk Help with simple regex (I think)
http://ab01-pre-net.ourdomain.com/health http://ab02-pre-net.ourdomain.com/health http://ab03-pre-net.ourdomain.com/health and http://nls01-pre-net.ourdomain.com/health http://nls02-pre-net.ourdomain.com/health http://nls03-pre-net.ourdomain.com/healthI'm useless at this, the was my attempt:
http://(ab*nls*)-pre-net.ourdomain.com/healthWhat am I doing wrong? I don't know why I find Regex so hard.
http://(ab.*nls.*)-pre-net.ourdomain.com/healthThanks
2023.05.03 19:43 kilroy1937 Replicating Ruby Regex in JavaScript
require 'csv' require 'pp' require 'active_support' FILE_NAME = "study2.csv" RESPONSE_COL_NAME = 'open_response' FILE_HEADERS = [ 'part_id', RESPONSE_COL_NAME, 'fact_phrases', 'opinion_phrases', 'fact_phrases_label', 'opinion_phrases_label', 'fact_phrases_t2', 'opinion_phrases_t2', 'total_words_t2' ] DONT_PHRASES = / dont don't do not can not cant can't/ PRONOUNS = /hesheitthey/i PRESIDENT_NAMES = /candidateclintondonaldgophillaryhilarytrumptrum/i SKIP_WORDS = / also really very much/ AMBIGUOUS_WORDS = /seemedprefe I_OPINION_WORDS = /agreebelieveconsiderdisagreehopefeelfeltfindopposethinkthoughtsupport/ OPINION_PHRASES = /in my opinionit seems to mefrom my perspectivein my viewfrom my viewfrom my standpointfor me/ OPINION_PHRASE_REGEXES = [ /(i(?:#{DONT_PHRASES}#{SKIP_WORDS})? #{I_OPINION_WORDS})/, /(i'm [a-z]+ to #{I_OPINION_WORDS})/, /#{OPINION_PHRASES},? /, ].freeze STRONG_FACT_WORDS = /arecan'tdemonstratedemontratedidhadisneedsshouldwillwould/ WEAKER_FACT_WORDS = /werewashas/ FACT_WORDS = /#{STRONG_FACT_WORDS}#{WEAKER_FACT_WORDS}/ FACT_PHRASES = // FACT_PHRASE_REGEXES = [ [/[tT]he [^\.]*[A-Z][a-z]+ #{FACT_WORDS}/, false], #fp1 [/(?:^.+\. )[A-Z][a-z]+ #{FACT_WORDS}/, false], #fp2 [/[tT]he [^\.]*[A-Z][a-z]+'s? [a-z]+ #{FACT_WORDS}/, false], #fp3 [/[^\.]*#{PRONOUNS} #{STRONG_FACT_WORDS}/, true], #fp4 [/(?:^.+\. )#{PRONOUNS} #{FACT_WORDS}/, true], #fp5 [/(?:^[^.]* )#{PRESIDENT_NAMES} #{FACT_WORDS}/, true], #fp6 [/(?:^[^.]* )(?:#{PRONOUNS}#{PRESIDENT_NAMES}) [a-z]+(?:ed[^ia]s) /, true], #fp7 [/(?:^[^.]* )(?:#{PRONOUNS}#{PRESIDENT_NAMES}) [a-z]+ [a-z]+(?:ed[^ia]s) /, true], #fp8 [/(?:$\. )(?:She'sHe's)/, true], #fp9 ].freeze CSV.open("C:/wd/CohenLab/post_Qintegrat/output_ruby_labels.csv", "w") do csv csv << FILE_HEADERS CSV.foreach(FILE_NAME, :headers => true , :encoding => 'ISO-8859-1') do row id = row['part_id'] response = row[RESPONSE_COL_NAME] if response.nil? csv << [id, response, 'NA', 'NA', 'NA'] next end response_words = response.to_s.split.map(&:downcase).map { w w.gsub(/[\W]/, '') } opinion_phrases = [] OPINION_PHRASE_REGEXES.each_with_index do p, index if response.downcase.match(p) found_phrases = response.downcase.scan(p) # Store the matched phrases along with the index of the regex in an inner array found_phrases.each do ph opinion_phrases << [ph, index] end end end opinion_phrases_t2 = opinion_phrases.length # Replace fact_phrases array with a hash fact_phrases = [] FACT_PHRASE_REGEXES.each_with_index do (p, allow_pres), index if response.match(p) found_phrases = response.scan(p) found_phrases.select! { ph ph if allow_pres !ph.match(/#{PRONOUNS}#{PRESIDENT_NAMES}/) } # Store the matched phrases along with the index of the regex in an inner array found_phrases.each do ph fact_phrases << [ph, index] end end end # Update the select! block to filter based on the phrase part of the inner array fact_phrases.select! do p, _ OPINION_PHRASE_REGEXES.none? { ph p.downcase.match(ph) } && !p.downcase.match(AMBIGUOUS_WORDS) end fact_phrases_t2 = fact_phrases.length output = [ id, response, fact_phrases.map(&:first).join('] '), opinion_phrases.map(&:first).join('] '), fact_phrases.map { _, v "regex#{v+1}" }.join(', '), opinion_phrases.map { _, v "regex#{v+1}" }.join(', '), fact_phrases_t2, opinion_phrases_t2, response_words.length ] csv << output end endJS File:
const history = []; // Ref: https://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm function parseCSV( strData, strDelimiter ){ strDelimiter = (strDelimiter ","); var objPattern = new RegExp( ( // Delimiters. "(\\" + strDelimiter + "\\r?\\n\\r^)" + // Quoted fields. "(?:\"([^\"]*(?:\"\"[^\"]*)*)\"" + // Standard fields. "([^\"\\" + strDelimiter + "\\r\\n]*))" ), "gi" ); var arrData = [[]]; var arrMatches = null; var header = null; while (arrMatches = objPattern.exec( strData )){ var strMatchedDelimiter = arrMatches[ 1 ]; if ( strMatchedDelimiter.length && (strMatchedDelimiter != strDelimiter) ){ arrData.push( [] ); } if (arrMatches[ 2 ]){ var strMatchedValue = arrMatches[ 2 ].replace( new RegExp( "\"\"", "g" ), "\"" ); } else { var strMatchedValue = arrMatches[ 3 ]; } if (arrData.length === 1) { header = arrData[0]; } // Now that we have our value string, let's add // it to the data array. arrData[ arrData.length - 1 ].push( strMatchedValue ); } var data = arrData.slice(1).map(function (row) { var obj = {}; for (var i = 0; i < header.length; i++) { obj[header[i]] = row[i]; } return obj; }); // Return the parsed data. return( data ); } const input = fetch("study2.csv"); function analyze(input) { console.log(input) input.then(response => response.text()) .then(csvText => { const fileData_raw = parseCSV(csvText,","); console.log(fileData_raw) const data = fileData_raw.filter(entry => entry.open_response && entry.open_response !== 'NA'); console.log(data) let response; for (let i = 0; i < data.length; i++) { const response = data[i].open_response; let response_words = response.toString().split(' ') .map((w) => w.toLowerCase().replace(/[\W]/g, '')); console.log('Response: ', response) const DONT_PHRASES_ARR = ["dont"," don't"," do not"," can not"," cant"," can't"]; const DONT_PHRASES = DONT_PHRASES_ARR.join(""); const PRONOUNS_ARR = ["he","she","it","they"]; const PRONOUNS = PRONOUNS_ARR.join(""); const PRESIDENT_NAMES_ARR = ["candidate","clinton","donald","gop","hillary","hilary","trump","trum"]; const PRESIDENT_NAMES = PRESIDENT_NAMES_ARR.join(""); const SKIP_WORDS_ARR = ["also"," really"," very much"]; const SKIP_WORDS = SKIP_WORDS_ARR.join(""); const AMBIGUOUS_WORDS_ARR = ["seemed","prefer"]; const AMBIGUOUS_WORDS = new RegExp(AMBIGUOUS_WORDS_ARR.join(""), 'i'); const I_OPINION_WORDS_ARR = ["agree","believe","consider","disagree","hope","feel","felt","find","oppose","think","thought","support"]; const I_OPINION_WORDS = I_OPINION_WORDS_ARR.join(""); const OPINION_PHRASES_ARR = ["in my opinion","it seems to me","from my perspective","in my view","from my view","from my standpoint","for me"]; const OPINION_PHRASES = OPINION_PHRASES_ARR.join(""); const OPINION_FRAME_REGEXES = [ {op_label: "op1", op_regex: new RegExp(`(?:i(?: dont don't do not can not cant can'talso really very much)? \\b(?:agreebelieveconsiderdisagreehopefeelfeltfindopposethinkthoughtsupport)\\b)`, 'gmi')}, {op_label: "op2", op_regex: new RegExp(`(?:i'm [a-z]+ to \\b(?:agreebelieveconsiderdisagreehopefeelfeltfindopposethinkthoughtsupport)\\b)`, 'gmi')}, {op_label: "op3", op_regex: new RegExp(`(?:in my opinionit seems to mefrom my perspectivein my viewfrom my viewfrom my standpointfor me),? `, 'gmi')} ]; const FACT_FRAME_REGEXES = [ {f_label: "fp1", f_regex: new RegExp(`(?:[tT]he [^\.]*[A-Z][a-z]+ \\b(?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwouldwerewashas)\\b)`, 'gm')}, {f_label: "fp2", f_regex: new RegExp(`(?:(?:^.+\. )[A-Z][a-z]+ (?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwouldwerewashas))`, 'gm')}, {f_label: "fp3", f_regex: new RegExp(`(?:[tT]he [^\.]*[A-Z][a-z]+?:(\'s)? [a-z]+ \\b(?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwouldwerewashas)\\b )`, 'gm')}, {f_label: "fp4", f_regex: new RegExp(`(?:[^\.]*(?:hesheitthey) (?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwould))`, 'gmi')}, {f_label: "fp5", f_regex: new RegExp(`(?:(?:^\. )?:(hesheitthey) \\b(?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwouldwerewashas)\\b)`, 'gmi')}, {f_label: "fp6", f_regex: new RegExp(`(?:(?:^[^.]* )\\b(?:candidateclintondonaldgophillaryhilarytrumptrum)\\b \\b(?:arecan'tdemonstratedemonstratesdidhadisneedsshouldwillwouldwerewashas)\\b)`, 'gmi')}, {f_label: "fp7", f_regex: new RegExp(`(?:(?:^[^.]* )(?:hesheittheycandidateclintondonaldgophillaryhilarytrumptrum) [a-z]+(?:ed[^ia]s) )`, 'gmi')}, {f_label: "fp8", f_regex: new RegExp(`(?:(?:^[^.]* )(?:hesheittheycandidateclintondonaldgophillaryhilarytrumptrum) [a-z]+ [a-z]+(?:ed[^ia]s) )`, 'gmi')}, {f_label: "fp9", f_regex: new RegExp(`(?:(?:$\. )(?:She\'sHe\'s))`, 'g')} ]; let fact_frames = []; let opinion_frames = []; // Check for opinion frames OPINION_FRAME_REGEXES.forEach(({ op_label, op_regex }) => { let op_match = response.match(op_regex); if (op_match) { opinion_frames.push({ match: op_match[0], label: op_label }); } }); // Check for fact frames FACT_FRAME_REGEXES.forEach(({ f_label, f_regex }) => { let fact_match = response.match(f_regex); if (fact_match) { fact_frames.push({ match: fact_match[0], label: f_label }); fact_frames = fact_frames.filter((frameObj) => { const lowerCaseFrame = frameObj.match.toLowerCase(); return ( OPINION_FRAME_REGEXES.every(({ op_regex }) => !op_regex.test(lowerCaseFrame)) && !AMBIGUOUS_WORDS.test(lowerCaseFrame) ); }); } }); console.log('Op Frames :', opinion_frames) let opinion_frames_t2 = opinion_frames.length; console.log('Op Fr Num: ', opinion_frames_t2) console.log('Fact Frames :', fact_frames) let fact_frames_t2 = fact_frames.length; let net_score = opinion_frames_t2 - fact_frames_t2; let id = data[i].part_id const result = { part_id: id, input: response, net_score: net_score, opinion_frames_t2: opinion_frames_t2, fact_frames_t2: fact_frames_t2, opinion_frames: opinion_frames, fact_frames: fact_frames }; const op_txt = opinion_frames.map(arr => arr.match); const fact_txt = fact_frames.map(arr => arr.match); const out_net = result.net_score const out_op_num = result.opinion_frames_t2 const out_fp_num = result.fact_frames_t2 const out_op = op_txt const out_fp = fact_txt const out_op2 = op_txt.join("; ") const out_fp2 = fact_txt.join("; ") var feedback_net = result.net_score var feedback_op_num = result.opinion_frames_t2 var feedback_fp_num = result.fact_frames_t2 var feedback_op = op_txt.join("; ") var feedback_fp = fact_txt.join("; ") // Update history history.push(result); updateHistory(); // Display result const output = document.getElementById('output'); output.textContent = `Net score: ${net_score}\nOpinion frames: ${opinion_frames_t2}\nFact frames: ${fact_frames_t2}`; }; }); }; var i = 0; function updateHistory() { const historyTable = document.getElementById('historyTable'); historyTable.innerHTML = ''; const headerRow = historyTable.insertRow(0); const headers = ['pid', 'input', 'net_score', 'op_fram_num', 'fact_fram_num', 'op_frames', 'fact_frames']; for (const header of headers) { const th = document.createElement('th'); th.textContent = header; headerRow.appendChild(th); } history.forEach((result, i) => { const row = historyTable.insertRow(); const cellId = row.insertCell(); cellId.textContent = result.part_id; const cellInput = row.insertCell(); cellInput.textContent = result.input; // cellInput.textContent = result.input.slice(0,50); const cellNetScore = row.insertCell(); cellNetScore.textContent = result.net_score; const cellOpinionFramesT2 = row.insertCell(); cellOpinionFramesT2.textContent = result.opinion_frames_t2; const cellFactFramesT2 = row.insertCell(); cellFactFramesT2.textContent = result.fact_frames_t2; const cellOpinionFrames = row.insertCell(); cellOpinionFrames.textContent = result.opinion_frames.map(obj => JSON.stringify(obj)).join(", "); const cellFactFrames = row.insertCell(); cellFactFrames.textContent = result.fact_frames.map(obj => JSON.stringify(obj)).join(", "); historyTable.appendChild(row); }); // center align table contents const tableElements = document.querySelectorAll('table, th, td'); tableElements.forEach(el => el.style.textAlign = 'center'); const firstColumnElements = document.querySelectorAll('th:first-child, td:first-child'); firstColumnElements.forEach(el => el.style.textAlign = 'left'); } analyze(input)
2023.04.29 12:35 Adventurous-Hair-355 Finding Duplicated Lines - What is wrong with my Vim Search Pattern ?
one one sadadsadad one one two two two one one three three one one three three four abc asadad ddsada abcdefghiMy vim search pattern is "\v^(.*)$(\_.*\1\_.*)@="
2023.04.25 03:49 AbideOutside Not matching on anything that is commented out ("--" before the string match)
2023.04.24 11:46 sukur55 Generating regex pattern automatically
alertmanager_notifications_total alertmanager_notifications_failed_total alertmanager_cluster_failed_peers alertmanager_cluster_reconnections_total alertmanager_cluster_reconnections_failed_total alertmanager_cluster_messages_received_total alertmanager_cluster_messages_sent_size_total go_memstats_other_sys_bytes go_memstats_next_gc_bytesregex
/alertmanager_(notifications_(totalfailed_total)cluster_(failed_peersmessages_(received_totalsent_size_total)reconnections_(totalfailed_total)))go_(memstats_(other_sys_bytesnext_gc_bytes))/gmhttps://regex101.com/sLXbAx/1
2023.04.19 18:40 Fast-Cardiologist705 terraform regex troubel
variable "name" { type = string description = "The name of the Azure Resource Group to create" validation { condition = can(regex("^EU-(PRDNPDNPUUATNPT)-RSG-TTT-(PLNODESECP)-[A-Z0-9]+-[A-Z0-9]+$", upper(var.name))) error_message = "Invalid name format. The name must match the pattern: EU-(PRDNPDNPUUATNPT)-RSG-TTT-(PLNODESECP)-Checked the regex on Regex 101 and it matches as expected- " } }
2023.04.17 13:26 MeIsALaugher Regex Generator?
2023.04.16 12:57 kevuwk Struggling with matching a string but only if it doesn't include an exclamation mark
2023.04.13 23:04 Gewerd_Strauss Regex while-loop match replacement: The bane of my existence continues (4)
.1 = GuiControlLoadImage(): On MetaData: 20221009 .2 = ISO8601: 20230413 .3 = Displayed Format: 13 04 2023_2023 April 13 .4 = Intended Format: dd MM yyyy_yyy MMMM d .5 = Intended Format > BackTransformed: 20230413I now want to remove all occurences of .
p:=1 while (p:=RegExMatch(text, "miO)(^((\.(\d\s\w)+\=\s)\s))", match, p)) { match_length:=StrLen(match[0]) mtc:=match[0] text:=StrReplace(text, match[0]) p-=match_length if (p<1) { p:=1 ;; in case the replacement would frameshift the position into the negative, reset it. } OutputDebug, % text OutputDebug, % p }I mean, it doesn't work, and I am obviously incapable of figuring out the flaw in my pattern. So... yay, here I am. AGAIN :/