[erlang-questions] Regex to match an empty string

Vik Olliver vik@REDACTED
Tue Feb 24 00:31:21 CET 2009


I'm trying to spot a parameter that is an empty string. The weapon of 
choice is regexp:first_match/2 which is used in the code that parses the 
config file.

In other worlds, "^$" matches an empty string. In Erlang, not so:

5> regexp:first_match("","^$").  
nomatch


What do I use instead?

Vik :v)



More information about the erlang-questions mailing list