Regular expressions - so difficult to learn

i've downloaded some of the rename scripts which are done with regular expressions on this site, but i would like to alter them.

i've googled for explanations of how they work, but am baffled with all the descriptions.

anybody know of a good guide for the total newbie?

For regular expressions in general, this site may help:

regular-expressions.info/tutorial.html

Try this: http://www.cuneytyilmaz.com/prog/jrx/

I'm sure that it will help you a lot :wink:

thanks for replies, but i have given up. so unbelievably difficult. i will just have to live without this ability.

Bah... don't give up dude!

Just scale back the amount of effort you want to put into it... take it slow, and start off with somethign real basic. Chances are that you are looking at somethign rather 'large' and daunting to 'start off with'.

Pick an example of something that works as is, give an idea on how you'd like to modify it to suit your needs, and we can hash out a discussion of how some of the basic principles work in order to understand how to mod existing scripts to fit your needs.

keep in mind... that if you're talking about 'scripts' and not just rename presets, an added layer of difficulty for you might be that you're looking at grasping MORE than just regex... but perhaps also whatever scripting language the scripts you've downloaded are written in... two separate things.

What scripts have you looked at so far that have you confuzled?

You should really give it a try, especially if you are programming - regexes are a very powerful tool, even when you just know the basics.

The site JohnZeman mentioned is a good starting point - maybe you should start with the Regular Expression Quick Start. Take one step at a while and experiment with what you learned. An absolutely excellent tool for beginners as well as pros is RegexBuddy (it's the author of the program who wrote the tutorials). It is very helpful for understanding and learning, and you even can pick regex tokens from a descriptive menu. After bulding a regular expression, you can test it extensively.

The tool isn't free, but it's sooo much better than the free Regex Coach, and you have a "three-month risk-free unconditional money-back guarantee".

When you have become a regex pro, RegexBuddy is still very useful - you can archive regexes you need more than once in the library, test your regexes thoroughly or even debug them, and make use of the syntax coloring when working with complex rules. Several different regex engines are simulated (.NET, Java, Perl, PCRE, JavaScript etc.).

Keep on trying! :slight_smile:

Cheers,
Jan

[quote="steje"]Bah... don't give up dude!

Just scale back the amount of effort you want to put into it... take it slow, and start off with somethign real basic. Chances are that you are looking at somethign rather 'large' and daunting to 'start off with'.

Pick an example of something that works as is, give an idea on how you'd like to modify it to suit your needs, and we can hash out a discussion of how some of the basic principles work in order to understand how to mod existing scripts to fit your needs.

keep in mind... that if you're talking about 'scripts' and not just rename presets, an added layer of difficulty for you might be that you're looking at grasping MORE than just regex... but perhaps also whatever scripting language the scripts you've downloaded are written in... two separate things.

What scripts have you looked at so far that have you confuzled?[/quote]

well it was this one that got me started.

Rename NUMBER=01 REGEXP PATTERN="^(.*)(.[^.]+)$" TO="{dlgstring|Enter base name} [#]\2"

was having a bit of bother renaming files the way i used to in explorer, so i got a hold of nudels very useful script (text and image above) which works great, but having seen it i would like to be able to do such things myself, but i am not really grasping the nettle yet..........

i got myself a copy of "Sams Teach Yourself Regular Expressions in 10 Minutes", but still really struggling.

i managed to do some simple stuff. like i have figured out how to select certain text and numbers, but i don't understand how to use that info to replace it with meaningful stuff???????????

If you like, send me pm with your e-mail and I'll send you a copy of the e-Book Beginning Regular Expressions by Andrew Watt, you won't regret it.

Feel free to post any rename requirements you have. You might find it easier to just show us how the files are named and how you'd like them to be named. Then someone here will provide you the required regex.

well it is not just for rename scripts. i own text workbench by silver age software, which is really useful, but would be more so if i could use regex.

Great Article:
Essential Guide To Regular Expressions

[quote="anjan_oleti"]Great Article:
Essential Guide To Regular Expressions[/quote]

Yeah i saw that earlier today (SM is on my daily reading list) and i must say, i have a grasp now on what once seemed like hieroglyphics to me. Really good Regex resource.