NogDog;10895802 wrote:First, you should use the preg functions instead of the ereg functions (which are essentially deprecated).
Anyway, could you give a couple specific examples of strings that should match, and maybe one or two that should not match but almost do? This is just to give me a better idea of what your actual requirements are. For instance, can the values for the "*" locations be any number of characters? Is "is" always "is", or can it be any string, and if any string can it have spaces in it?
i was thinking about preg.
anyways, here are some strings
1 is 1-
a is a-
g4 is g4-
lol is lol-
no is no-
0000 is 0000-
543210 is 54321-
a7a72 is a7a72-
and some strings that should not work
a is b-
4 is 1-
abc is 12-
life is death-
test is tset-
4f3g is 4f3g-
and special characters could work, as long as it cant become a security breach. originally i was planning on [a-zA-Z0-9] or something along those lines, but special characters are fine, granted they dont allow mysql injection or xss, etc.
so if you can incorporate special characters, here would be some examples
a$ is a$-
@3# is @3#-
l@l is l@l-
and that dont work
$#@ is T$#-
$g4^ is #W@#sd-
%HE is 3SgE3@-
you should get the idea
thanks so much!