Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm prompting a user to enter a database name and attempting a match on the pattern entered. If it matches a certain set of forbidden names then the user is asked to retry. The database names which are valid consist of alphanumeric and an underscore is also allowed. The system databases are not allowed. Here is what I've got so far .. which isn't working as I expected.
So if they enter any of these names they should be rejected'[^(master|model|dbccdb|sybsecurity|sybsystemdb|sybsystemprocs|tempdb| +DBA)][a-zA-Z0-9_]+'
However the above code is not doing an exact word match like I expected since it's still rejecting valid names e.g. ed123master model dbccdb sybsecurity sybsystemdb sybsystemprocs tempdb DBA
Any help would be welcome
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: exact word match
by samarzone (Pilgrim) on Dec 22, 2010 at 12:23 UTC | |
|
Re: exact word match
by johngg (Canon) on Dec 22, 2010 at 12:23 UTC | |
by Anonymous Monk on Dec 22, 2010 at 13:03 UTC | |
|
Re: exact word match
by cdarke (Prior) on Dec 22, 2010 at 12:12 UTC | |
|
Re: exact word match
by ww (Archbishop) on Dec 22, 2010 at 13:57 UTC | |
|
Re: exact word match
by Anonymous Monk on Dec 22, 2010 at 12:27 UTC | |
|
Re: exact word match
by Marshall (Canon) on Dec 23, 2010 at 07:52 UTC |