Matching a Dot with regex...
Posted: Tue Jan 20, 2009 3:59 pm
I'm currently using string.gsub(); to match & replace a dot with regex.
eg.
Everybody needs somebody to love.wsasdagsegadasd.dasftj
Everybody needs somebody to love. I can't love.asdsgewgfawd
Off this example I can tell that a valid sentence would consist of a ". " and an invalid sentence of ".".
My problem now is, that you cannot use a dot to match except if you're escaping it (which would be \\.),
but does not work.
What Regex do I need to use to match a simple dot?
eg.
Everybody needs somebody to love.wsasdagsegadasd.dasftj
Everybody needs somebody to love. I can't love.asdsgewgfawd
Off this example I can tell that a valid sentence would consist of a ". " and an invalid sentence of ".".
My problem now is, that you cannot use a dot to match except if you're escaping it (which would be \\.),
but does not work.
What Regex do I need to use to match a simple dot?