Page 1 of 1

Character classes in RegEx

Posted: 31 Jul 2012, 15:32
by SvA
Ether wrote:The regex implementation used in Salamander uses predefined character classes in the [[:digit:]] format.
The documentation of the RegEX library by Henry Spencer says so, alone I cannot get it to work in Salamander. Moreover it is not mentioned in Salamander's help file. (I consulted documentation to Henry Spencer's RegEx library, because I could not find a library named REGEXP as stated by Salamander's help file)

Are predefined character classes supported by Salamander's Regex?
Is there any way to specify a a control character in a regex or any other way to search for horizontal whitespace consisting of blanks and/or tabs?

(I experimented with search within internal viewer, but regexp ought to be consistent throughout the program anyway.)

May I suggest to Altap development team to switch to a more modern regex library when adding unicode support, one that supports shorthand character classes, hex- octal- and unicode codepoint character specification, non-greedy operations ...

Re: Character classes in RegEx

Posted: 31 Jul 2012, 16:02
by Ether
I'm all in for a more powerful regex library. I'm used to Perl regexes and when I write patterns in other applications (SciTE, Salamander), sometimes I wonder why they're not working (then I realize that some parts are apparently not supported).
SvA wrote:Are predefined character classes supported by Salamander's Regex?
Just invoke Batch Renamer and click on the black arrow next to the Search for field and look in the submenus. They should work everywhere Salamander accepts regular expressions.

Re: Character classes in RegEx

Posted: 31 Jul 2012, 16:20
by Jan Rysavy
The Renamer plugin is using own implementation of regular expressions, it is not using internal Salamander Regex library from Henry Spencer. Renamer has regular expressions nearly compatible with http://www.pcre.org/

Note: we should consider Visual C++ TR1 regular expressions (2008+) http://www.johndcook.com/cpp_regex.html or Boost.Regex library http://stackoverflow.com/questions/1816 ... ould-i-use