Top "Lookahead" questions

Regular expression lookarounds are zero-width assertions that verify conditions about the context of a match at the current match position.

Regular Expressions: Is there an AND operator?

Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well? Specifically, …

regex lookahead
Regular expression negative lookahead

In my home directory I have a folder drupal-6.14 that contains the Drupal platform. From this directory I use the …

regex lookahead negative-lookahead
String negation using regular expressions

Is it possible to do string negation in regular expressions? I need to match all strings that do not contain …

regex lookahead negative-lookahead negation
Match a pattern only once

I have a string foo-bar-bat.bla I wish to match only foo My flawed pattern matches both foo and bar \…

regex lookahead find-occurrences
How to match multiple words in regex

Just a simple regex I don't know how to write. The regex has to make sure a string matches all 3 …

php javascript regex programming-languages lookahead
Need a regex to match a variable length string of numbers that can't be all zeros

I need to validate an input on a form. I'm expecting the input to be a number between 1 to 19 digits. …

regex validation pcre lookahead negative-lookahead
Javascript won't split using regex

Since I started writing this question, I think I figured out the answers to every question I had, but I …

javascript regex split lookahead
LR(1) Item DFA - Computing Lookaheads

I have trouble understanding how to compute the lookaheads for the LR(1)-items. Lets say that I have this grammar: …

parsing context-free-grammar lookahead dfa lr
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
Regex to match all permutations of {1,2,3,4} without repetition

I am implementing the following problem in ruby. Here's the pattern that I want : 1234, 1324, 1432, 1423, 2341 and so on i.e. the …

regex permutation lookahead negative-lookahead