Regex: Using lookahead assertion to check if character exist at most a certain number of times

Posted by teggy on Stack Overflow See other posts from Stack Overflow or by teggy
Published on 2010-03-05T00:13:37Z Indexed on 2010/03/11 19:14 UTC
Read the original article Hit count: 302

Filed under:
|

How do I use lookahead assertion to determine if a certain character exist at most a certain number of times in a string.

For example, let's say I want to check a string that has at least one character to make sure that it contains "@" at most 2 times. Thanks in advance. Using python if that matters.

© Stack Overflow or respective owner

Related posts about regex

Related posts about python