9 lines
177 B
Lua
9 lines
177 B
Lua
test = "My name is Lua."
|
|
pattern = ".*name is (%a*).*"
|
|
|
|
if test:match(pattern) then
|
|
print("Name found.")
|
|
end
|
|
|
|
sub, num_matches = test:gsub(pattern, "Hello, %1!")
|
|
print(sub)
|