string.gsub help
Hello, help me with regular expressions.
How to make that at the beginning of the word and after each 3 symbols was "!" ? Example: !Hel!lo !Wor!ld. !Tes!t !lua!. thx. |
I can see this as a series of 3 string.gsub() calls:
Code:
("Hello World. Test lua."):gsub("(%S%S%S)","%1!"):gsub("(%s)(%S)","%1!%2"):gsub("^(%S)","!%1"); |
All times are GMT -6. The time now is 01:32 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI