Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Browsing latest articles
Browse All 220 View Live

Redirection with exclusions RegEx

I'm using the Redirection plugin by John Godley on our WordPress site, and I want to create a redirect rule that applies to multiple URLs, but also excludes 2 specific urls. With a little help from...

View Article



Need help with Regular expression

I have different file name pattern as follows. ABCD_ABCDEFGH_PARB_ALLB_CCYYMMDD-HHMMSS.TXT SDCD_NKEDHEI_ALLIA_PARTN_CCYYMMDD-HHMMSS.TXT UN_URKSLJIE_EXTRACT_DATA_ALLT_PART_CCYYMMDD-HHMMSS.TXT And I was...

View Article

How to insert a space at the beginning of a line in a "for next" code loop...

How to insert a space at the beginning of a line in a "for next" code loop (.NET regular expressions) I am trying to add spaces at the beginning of lines matched with look aroundsfor line of code line...

View Article

Regex search and replace? Tabs ...

I have a regexp that works, in my software I search for timestamps with this: [01]?[0-9]:[0-5][0-9] and a macro replaces the carriage return with a tab and then I proceed from there. But it's very...

View Article

RegEx remove duplicate need help

Hi, not good at RegEx and trying to remove some duplicate values. data is in CSV, part of it looks like this: "/content/7/66345/images/590009.jpg , "/content/7/66345/images/590009.jpg ,...

View Article


Exclude already masked data in regex

hi I am trying to mask 3 to 8 digit numbers alone exclusively, by excluding already masked data with another regex pattern. For example it should not match the masked patterns like [xX\-\*\d{1,4}] ,...

View Article

MySQL Select query that chooses something dot something between certain...

I have a MySQL column with underscores and between those underscores a domain name (which is anything with a dot, except number.number), and I like to use REGEXP_SUBSTR to extract that domain, but only...

View Article

learning regex isn't easy :-)

hi all, so, I'm new to regex, trying to understand and i admit i'm lost. here's what i need right now; i have a list of string where i wish to extract the email address of users, each line looks like...

View Article


Exclude Uppercase for conjoined names

Hello! I'm new to learning regex and I cant seem to figure out how to exclude certain characters from my regex. In my example I want to structure names as FIRST_NAME, LAST_NAME. Meaning "Rog er ,...

View Article


Regular Expression for a repeating pattern?

I've got some data input by a user. it's like <span>&nbsp; &nbsp; </span> and this can be any number of this non-breaking space up until the close of the span tag, with nothing...

View Article

Replacement of initial words

Good morning everyone, I can't use regular formulas I basically have to look for initials (jolly)"se_meta":90 And I have to replace Work09Document2023”se_meta”:90 Thanks and best regards Roberto Grigis

View Article

pattern replace with specific exception

I am looking for a substution RegEx which prefixes all words with a caret, except when followed by a bracket. E.g. "func(x)=y" must be replaced by "func(^x)=^y" . I came up with (in Python code):...

View Article

Help me regexp gurus please problem is matching files and copy

original folder "datasets to optimize" contains 1000s files like this variable 2-3 dots and 1 dot with numbers 1.87.184 and 0.35643634, and sometimes they contain (#num#) at the end of number how to...

View Article


Regex: more than one identical character next to each other?

Hello all, I'm a newbie to regex and need some help. What I want to do is to check if a filename contains two or more _ beneath each other. For example: painting__test.pdf or painting___test2.pdf those...

View Article

Image may be NSFW.
Clik here to view.

Help for a regexp

Good morning I need to "purify" sentences to be able to use them in an app. Thanks a lot for your help in helping me build the right code I think the pattern is: - 'any sentence' (0 or 1 time) {text...

View Article


Does anyone have experience with creating the regex rule for a fail2ban filter?

I am trying to create a filter for AH01264 errors. This is for bots trying to run standard "php"s or "pl"s off of my home server. While I have figured out how enter and activate new filters in...

View Article

Regular expression for City name

I have two scenarios in table one is name of person and another is cityname but both name of the person and cityname starts with capital letter and followed by small letters I want different regular...

View Article


Matching Floating Point Numbers Range with a Regular Expression

I have to check the user input in some input fields for a float value range with Regex. Here are my two float value ranges for which I have not yet found a solution: ``` Case 1. (ui >= 0.0001) &...

View Article

Modify Regex To Disallow Spaces

I am using this regex to verify a password contains at least one letter, one number, min 7 chars in PHP, how do I modify to dissallow any spaces?:PHP /(?=.*\d)(?=.*[a-zA-Z]).{7,}$/ Thanks

View Article

PHP perl regular expression - URL not preceded by equal sign and possible...

I'm trying to create a perl regular expression that matches a URL that is not preceded by an equal sign and one single or double quote (optional) ignoring whitespace. The code below gives an error:...

View Article
Browsing latest articles
Browse All 220 View Live




Latest Images