Hi, I have a attachment macro and want some files NOT displayed.
I have 3 regular expressions that work fine if I use every one of them alone
^((?!.*[Ss][Dd][Ss]*.*).)*$,
^((?![Ee][Ss].*).)*$,
^((?![Ss]pec.*).)*$
I combined them in one and that didnt work because of the "$" - it says here ist the end of the expression.
So I came up with
^((?!.*[Ss][Dd][Ss]*.*).)*, ^((?![Ee][Ss].*).)*, ^((?![Ss]pec.*).)*$
Still not working.
I think the comma is used as a (text1|text2) OR expression in the background. I don't know.
Any ideas?
Hi Lars,
The expression should look like this:
^((?=(?!.*[Ss][Dd][Ss]*.*))(?=(?![Ee][Ss].*))(?=(?![Ss]pec.*)).)*$
Thank you for your very fast solution :) You made my day.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome, Lars!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recognized a small problem.
I have these two files which are not listed:
It is because of the (?=(?![Ee][Ss].*) part.
It recognizes the es in the middle of "questionnaire". I thought the filter says that the word must start with [Ee][Ss].
What would be the correct syntax to filter es* at the start of a filename?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not good at these...but after reading parts of this thread: https://stackoverflow.com/questions/406230/regular-expression-to-match-a-line-that-doesnt-contain-a-word
I added a point at the end (.*$)
here the complete regex:
^((?=(?!.*[Ss][Dd][Ss]*.*))(?=(?![Ee][Ss].*))(?=(?![Ss]pec.*)).).*$
for this special case the solution works. but I'm not quite sure if it fits every situation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.