lookbehind Questions
3
Solved
I have this regex that uses forward and backward look-aheads:
import re
re.compile("<!inc\((?=.*?\)!>)|(?<=<!inc\(.*?)\)!>")
I'm trying to port it from C# to Python but keep getti...
Fireworm asked 25/6, 2012 at 21:26
3
Solved
I am looking to match a string "Order By XXX" where XXX can be any letter, number, period, comma, space or square bracket. However, I would only like to match this if it is not surrounded by parent...
Nairobi asked 14/6, 2012 at 14:4
5
Solved
I have this pattern written
^.*\.(?!jpg$|png$).+$
However there is a problem - this pattern matches file.name.jpg (2 dots)
It works correctly (does not match) on filename.jpg. I am trying to f...
Lexington asked 7/4, 2012 at 5:24
2
Solved
I have user input where some tags are allowed inside square brackets. I've already wrote the regex pattern to find and validate what's inside the brackets.
In user input field opening-bracket coul...
Boss asked 8/3, 2012 at 6:0
2
Solved
Is there a way to do negative and positive lookbehind in VBA regex?
I want to not match if the string starts with "A", so I am currently doing ^A at the start of the pattern, then removing the fir...
Tenorrhaphy asked 5/2, 2012 at 15:48
1
Solved
Making an argument parser. I want to split a string into an array where the delimiter is ", " except when preceded by "|". That means string
"foo, ba|, r, arg"
should result in
`["foo", "ba|, r...
Chavez asked 30/9, 2011 at 3:18
1
Solved
I need to emulate the behavior of \b at the start of a string, where I'm adding additional characters to the set that count as a word boundary. Right now I'm using something like:
"(?<=\\W|\\p{...
Extant asked 11/1, 2011 at 17:42
1
Solved
I am doing some replaces in some huge SSIS packages to reflect changes in table- and column names.
Some of the tabels have columnnames witch are identical to the tablenames and I need to match the ...
Hammad asked 26/10, 2010 at 9:19
3
Solved
How can I use lookbehind in a C# Regex in order to skip matches of repeated prefix patterns?
Example - I'm trying to have the expression match all the b characters following any number of a charac...
Vanmeter asked 1/10, 2010 at 13:39
4
Solved
I want to parse the 2 digits in the middle from a date in dd/mm/yy format but also allowing single digits for day and month.
This is what I came up with:
(?<=^[\d]{1,2}\/)[\d]{1,2}
I want a ...
Equation asked 1/7, 2010 at 15:58
2
Solved
I have the following regex in a C# program, and have difficulties understanding it:
(?<=#)[^#]+(?=#)
I'll break it down to what I think I understood:
(?<=#) a group, matching a hash. what...
Henrion asked 22/6, 2010 at 11:55
1
Can you use backreferences in a lookbehind?
Let's say I want to split wherever behind me a character is repeated twice.
String REGEX1 = "(?<=(.)\\1)"; // DOESN'T WORK!
String REGEX2 = "(?<...
Dapple asked 29/4, 2010 at 5:34
3
Solved
In the "Advanced Regular Expresssion" chapter in Mastering Perl, I have a broken example for which I can't figure out a nice fix. The example is perhaps trying to be too clever for its own good, bu...
Absorber asked 24/2, 2010 at 23:22
3
Solved
I use
(?<!value=\")##(.*)##
to match string like ##MyString## that's not in the form of:
<input type="text" value="##MyString##">
This works for the above form, but not for this: (I...
Genie asked 5/2, 2010 at 23:50
© 2022 - 2024 — McMap. All rights reserved.