Category "regex"

VSCode snippet regex for extracting directory and replacing slashes?

I'm struggling to find a VSCode transformation regex that allows me take a string like this:MyProject.Api/Data/RandomPath/Entities/User.ts and produce:MyProject

Chatbot-specific answers

I'm creating a chatbot that asks questions and answers questions, but for now it doesn't have a specific function of answering specific questions that it asks i

Trailing context match EOF flex-lexer

I want to match these two tokens: 1. NUM: A series of characters in [0-9_] with an optional . in between. 2. ID: A series of characters in [a-zA-Z0-9_] with at-

Regex in c++ for maching some patters

I want regex of this. add x2, x1, x0 is a valid instruction; I want to implement this. But bit confused, how to, as I am newbie in using Regex. Can anyone share

Matching number with regex

Need a single combined regex to match the following logic: The number should be 8 digits long, the 8th digit should be the remainder of (the first 7 digits / 7)

Regex to match anything after a delimiter

I have the following case: Time format and some description which is separated by a delimiter - (as like below) 00:00 - Hello element I was using the below rege

Regex Error: A lookbehind assertion has to be fixed width [duplicate]

My pattern works in JavaScript. (?<=(?:username|Email|URL)(?:\s|:))[^\n]+ However, when I try to use it in PHP, I get this error: A lookb

Grep and CMD escaping

I am trying to grep this pattern: ^#include\s+"[^"]+" Unfortunately, when I try the following in a Windows batch file, the pipe (|) and the sort are treated as

Remove "." from digits

I have a string in the following way = "lmn abc 4.0mg 3.50 mg over 12 days. Standing nebs." I want to convert it into : "lmn abc 40mg 350 mg over 12 days. St

Sublime Text 3 - Regex find/replace first captured group with second captured group?

I have two XML files I'm editing using Sublime Text 3. The first file acts as a template, while the second file is based on data export that is a batched XML fi

RegExp constructor adding unexpected comma to pattern

trigoOperators is an array containing some trigonometric operations. The goal is to create a regular expression that parses a string equation into an array. The

Get key=value pairs from a string with regex

I have a string that looks something like: x = """\ names=['m','c'], \ nmodes=2, \ mus=[[-5.0, -5.0], \ [5.0, 5.0]], \ sigmas=[[1.5, 1.5], [2.1, 2.1]],

regex "split by commas Saving an inner comma"

I am building a report of active directory distribution groups and i want to get the ManageBy returned as Aviles Gutierrez, Abraham instead of th

Is it possible to replace a value in a json string that occurs multiple times only at the top level of the structure via regex?

Hiho, I have a json string with the following structure: { "version": "1.0.0", "dependencies": { "version": "1.0.0" } } It can also look like th

Grok pattern to remove "ms" from log string and convert to INT

first time long time. I have this log message: 2022/05/04 09:24:08 INTERESTING UpdateStatus: active: 45 waiting: 0 connections: 91 max dbcmd queue length: 3 max

Regex How to ignore only one url type

I have a problem, where I can't allow a word + any type of url, but I want to ignore the text that contains the url hacking.com Valid: Buy Cell Phone at https

Preg_match function in PHP 8.1 does not work properly

I am using the preg_match function in PHP 8.1, but unfortunately, this function does not give me any output. I am looking for @extends('admin.layouts.app') in m

Regex validation for a specific value with React Formik

First is, I want to validate the field that if the user type a character that is not existing in this (e.g.): /[ùûüÿ€’“&

Regex to match Number of 1-3 Digits After a Known String in Ruby

I need to match the numbers in the following strings. It is possible they may be part of longer strings with other numbers in them, so I specifically want to ma

Angular 7 email validation using regex on reactive form

On Angular, I am trying to validate email using following regex - ^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.