Course of Raku / Regexes and grammars / Regexes / Lookaround assertions / Exercises

Not followed by

Problem

Write a pattern that matches a number only when it is not followed by a % sign (a negative lookahead). Test it on '50 dollars' and print a plain True or False.

Example

The program prints:

True

Solution

See the solution

Course navigation

Solution: A bare number   |   Solution: Not followed by