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?
Matching a Dot with regex...
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Re: Matching a Dot with regex...
Try "%.", Expressions use "%" instead of "\" in Lua.
http://www.gammon.com.au/forum/?id=6034
Ref:Nick Gammon wrote: There are some "magic characters" (such as %) that have special meanings. These are:
^ $ ( ) % . [ ] * + - ?
If you want to use those in a pattern (as themselves) you must precede them by a % symbol.
http://www.gammon.com.au/forum/?id=6034
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Matching a Dot with regex...
Thank you, works like that.
Who is online
Users browsing this forum: No registered users and 28 guests