in reply to Is there a regex match for an empty string ?

/^$/

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: Is there a regex match for an empty string ?
by Eliya (Vicar) on Mar 19, 2012 at 23:21 UTC

    or better /^\z/   (as /^$/ also matches "\n", which is not an empty string).

A reply falls below the community's threshold of quality. You may see it by logging in.