Skip to main content
lookahead

lookahead

8.9
A test that checks if specific characters come after the current place without including them in the match
  • noun
  • /ˈlʊkəˌhɛd/
  • Specialized
translation icon : lookahead
  • The regex engine uses a lookahead assertion to check for a digit immediately after the current character without consuming it.

Examples

  • To ensure a string contains a vowel, you can use a lookahead to verify that at least one vowel follows the current character.

  • The second stage is the carry-propagate-add stage, which performs a 161-bit one's complement add using a carry-lookahead adder.

    Academic text (1996)
  • Since carry-lookahead incrementers are smaller and faster than carry-lookahead adders, the actual CLA is only 88 bits wide.

    Academic text (1996)
  • Since carry-lookahead incrementers are smaller and faster than carry-lookahead adders, the actual CLA is only 88 bits wide.

    Academic text (1996)
  • The propagation from the carry-lookahead incrementer and the group identifier generated by the 87-bit CLA are fed back to the carry-in to correct the end-around-carry problem without a closed loop.

    Academic text (1996)
  • In regular expressions, a lookahead allows you to assert that a specific sequence of characters follows the current position without including them in the match.

Surface Forms

lookahead singular
lookaheads plural

Morphology

lookahead = look (transparent) = ahead + look

The compound is a direct combination of 'look' + 'ahead' meaning to check or 'look' forward to what comes next; the mapping is predictable. [Postprocessing: moved 'ahead' from base_words to prefix]

Etymology

Lookahead comes from the words look and ahead, meaning 'look forward'. In regular expressions a lookahead is like a quick look at the characters ahead without taking them into the match, which is why the name fits.