Top "Lookbehind" questions

A lookbehind is a part of the regular expression standard.

How to match the first word after an expression with regex?

For example, in this text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu tellus vel nunc pretium lacinia. …

regex lookbehind word-boundary
Regular Expression Lookbehind doesn't work with quantifiers ('+' or '*')

I am trying to use lookbehinds in a regular expression and it doesn't seem to work as I expected. So, …

regex lookbehind
What's the technical reason for "lookbehind assertion MUST be fixed length" in regex?

For example,the regex below will cause failure reporting lookbehind assertion is not fixed length: #(?<!(?:(?:src)|(?:href))=["\']?)((?:https?|…

regex pcre lookbehind
Python regex lookbehind and lookahead

I need to match the string "foo" from a string with this format: string = "/foo/boo/poo" I tied this …

regex regex-lookarounds lookbehind
Regex pattern that does not match certain extensions?

I have this pattern written ^.*\.(?!jpg$|png$).+$ However there is a problem - this pattern matches file.name.jpg (2 dots) …

python regex lookbehind
Java regex error - Look-behind group does not have an obvious maximum length

I get this error: java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 22 ([a-z])(?!.*\1)(?&…

java regex lookbehind
Regular Expression - Match all but first letter in each word in sentence

I've almost got the answer here, but I'm missing something and I hope someone here can help me out. I …

regex lookbehind lookahead
How can I use lookbehind in a C# Regex in order to skip matches of repeated prefix patterns?

How can I use lookbehind in a C# Regex in order to skip matches of repeated prefix patterns? Example - …

c# regex lookbehind
Does lookbehind work in sed?

I created a test using grep but it does not work in sed. grep -P '(?<=foo)bar' file.…

regex sed grep lookbehind
Lookbehind on regex for VBA?

Is there a way to do negative and positive lookbehind in VBA regex? I want to not match if the …

regex vba lookbehind negative-lookbehind