Matching with exclusion?

1 view
Skip to first unread message

Benoit Lefebvre

unread,
Sep 1, 2009, 11:37:48 AM9/1/09
to Regex
We have a software here that do a regex check for the usernames that
runs it.

All our usernames are as following: A letter followed by a set of 5
numbers.

Currently, in the config we have a line like that:

^a[0-9]{5}$

To specify that every users starting with the letter "a" can run it.

We are having an issue with one user (a34882) and we want to exclude
him

Unfortunately the software was not designed with an exclusion list

How can I add the username in the regexp that match the users to
exclude a34882 ?

Thanks,
--Ben

ThomasW

unread,
Sep 10, 2009, 8:21:20 PM9/10/09
to Regex
I have a similar problem and found (?!...) does the job ("..." is the
expression to be excluded).

Thomas W.

Benoit Lefebvre

unread,
Sep 21, 2009, 8:12:44 AM9/21/09
to Regex
The application uses pcre, this is not working.

I tested the ?! with perl it's fine but pcre don't seems to be liking
that

any other solutions? Editing the program is not an option right now

Thanks,
--Ben
Reply all
Reply to author
Forward
0 new messages