Regular Expression Search of One or More Characters?

I am looking to find files/folders that contain at least 20 of the following characters:

[a-zA-z0-9_.-]

This is quite easy to do using most regular expression syntaxes, but I am not sure how this can be done using Dopus. I know that the "." character is often used to find multiple characters, but how about finding "x or more characters"?

Thanks!

Hello ,

I'm not quite certain exactly what you are attempting to find with this.
Could you post a few specific examples?

DOpus Regular Expression Syntax is smewhat limited as of today,
but Jon has indicated an upgrade is in the works for a future version.

Curly brackets of the form {n,m} do NOT work in the current version of DOpus.
It's not all bad though, one can still specify the match n + 1 times,
and then place a * after it to match 0 or more times for instance.

I'm only guessing, but as a start,
are you attempting to find files that contain 20 or more matches of any of a-z or A-Z or 0-9 ?
I don't know what you are doing with the '.' character.
Unless escaped with a '' character, the '.' character will match any character.

([a-z]|[A-Z]|[0-9])([^a-z]|[^A-Z]|[^0-9])* (twenty times) then .*

I'm only guessing though.

:opusicon: Porcupine

Do the matched characters have to be contiguous?

You only want to match those chars, right? No brackets, etc.? (If you just want to find any filenames longer than 20 characters and don't care what the characters are then that's really easy.)

I would like to match the following examples:

[search] alt.binaries.shn --- Dave.Matthews.Live.in.Arizona-2006 [01/20]

The regex will rename the folder to Dave.Matthews.Live.in.Arizona-2006

Either "." or "_" will usually takes the place of the space character.

Thanks!

Would matching everything after the first "--- " and before the last " [" do the job?

Actually, am I missing something? That can't be the filename to be matched since it has a / in it.

Hi brianafischer,

Cool problem.

Are there always three --- characters preceding the part of the filename you wish to keep?
Do any of these filenames contain a '[' character in the part of the filename you wish to keep?
Are any other characters ever used in the part of the filename you wish to keep?

@Nudel,
As you were posting your reply, I was wondering if it was a stealth Oxford Rhodes Scholar problem ! ( joke )
Do this in one line using only RegExp.
The '/' character is probably just a typo.

Hang in there brianafisher, we just might get it !
I'm thinking on it.

Regards,
:opusicon: Porcupine

I wish! I am quite familiar with the regular expression syntax, so I often look for unique patterns that apply to all cases. However, the only pattern I found is the "n or more" characters. If the "---" was unique, a simple:

OLD NAME: (.*--- )(.*) NEW NAME: \2

would have been done. I think this is a case where the "n or more matched symbols has to be met.

[search] alt.binaries.shn --- Dave.Matthews.Live.in.Arizona-2006 [01-20]

The regex I need will rename the folder to "Dave.Matthews.Live.in.Arizona-2006" not including the [01-20]. Any advice?

Thanks!

I can't think of a good way to do that using regular expressions. :frowning:

Do the files tend to be tagged? (I know the one SHN live recording I got was missing tags so maybe not.) If they are then a better solution might be to move the files based on their tags, although I don't know if many music organising programs support SHN. (Could transcode to FLAC, then organise. Will save some space as well then. :slight_smile:)

I have done this in VBScript, perl, and Visual Basic's regular expression language with a simple line:

[\w\.-]{20,}"

where \w Matches any word character including underscore. Equivalent to [A-Za-z0-9_]

The SHN was just one example, but the rename has to be based upon the folder name.

Hello ,

To be quite honest, my instinct tells me to write a C++ command line program to do this.

However,
I really am working on this.
Does this help?

(--- )((.*\.)*.*)(\[[0-9][0-9])

Regards,
Porcupine

How about this ?

Old Name : (--- )((.*\.)*.*)(\[[0-9][0-9].[0-9][0-9]\]\.)(.*) New Name : \2\5 RegExp

Renames to :
Dave.Matthews.Live.in.Arizona-2006 ext where ext is the file extension.

Regards,
:opusicon: Porcupine

Hello,

And if the space character in the wanted part of the filename remains a space character,
or has been changed to a '.' or a '_', this might work.

Old Name: (--- )((.*(\.|_| ))*.*)(\[[0-9][0-9].[0-9][0-9]\]\.)(.*) New Nme: \2\6 RegExp

I still think a C++ command line program is the better option here,
but that's just me .

Regards,
:opusicon: Porcupine

After doing some research, it appears that dopus does support ranges. I can use a vbscript for now, but will this be added in the future? I think it would be value-added and used by many.

As porc said earlier, Jon's indicated that this is something he plans to improve.

Thanks for the notice, I will be awaiting semi-patiently! :smiling_imp: