I want to make a pattern that matches only when a string contains no arabic or roman numerals (note that the roman numerals can only go up to X
(10))
Examples:
"Rock" <-- matches
"Rock IV" <-- doesn't match
"Rock 4" <-- doesn't match
"Rock Paper" <-- matches
"Rock Paper Scissors" <-- matches
"Rock Paper VIII" <-- doesn't match
"Rock Paper 8" <-- doesn't match
My current code only allows for the usage of 1 word and a numeral. My goal is to make it so it only doesn't match when a numeral is present. Code:
"^([^%s]+)$"
As the title says, I am using Lua. I can also note that the code will be used on one of the fandom wikis, so syntax should match Scribunto syntax.
There is no pattern I can think of that would match what you need in one go with any possible word.
This matches any string that does not end with space and digits.
This would fail for words that with Roman digits like "RockM".
Often it is easier to match something that to not match something.
If you just want to check it might be easier to search the string for
[0-9IVXLCDM]