if string.sub(str,1,1) == "^" and string.sub(str,#str,#str) == "^" and not ( string.find(str," ") ) then
If word has first character as ^ and last character as ^ and has no spaces then
Or to also include the earlier post
local startNum = string.find(str,"%^%w+%^")
local endNum
if startNum then
endNum = string.find(str,"%^",startNum + 1)
end
if endNum then
endNum = endNum - 1
startNum = startNum + 1
--# BAM it's enclosed in ^'s
end
Or hell, if you just want the pattern to know if it's in the string:
local isThere = string.match(str,"%^%w+%^")
if isThere then
--#Do stuff
end
Edited by Dragon53535, 15 January 2016 - 11:33 PM.