WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Strings

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Regular Expressions and WinBatch


WinBatch doesn't have built in regular expression support. However here is a tool that might be useful:

http://www.silveragesoftware.com/rxl.html

Regular Expression Laboratory is an assistant simple to use tool to help you learn and prepare regular expressions. If you are a developer or just concerned with text processing tasks, the Regular Expression Laboratory is a tool that you need. In fact, you felt that you need a program like this but could not formalize your needs. We have done this job for you. Now you can construct your regular expressions with much ease and test them by applying to an arbitrary text. Regular Expression Laboratory support the incredible size of a stored regular expression: 2MB!

Note: There are some quirks about the behavior of the RegExp object of the Scripting Runtime library, especially with regard to newlines and replacements in which the replacement string is significantly longer than the match string.

Newlines
Newlines are detected when you search for them alone, using a RegExp of "\n" but newlines embedded in a Regexp don't match. Another regular (I can't remember who said it.) suggested that "\r\n" works when embedded in a longer expression. However, I have not tested this, as I had already worked around the problem by another method.

Long Replacement Strings
When the replacement string is long, the replacement operation can corrupt the string to which it is applied. This is a repeatable behavior, in scrrun.dll, version 5.6.0.8820, although I haven't yet got around to reporting it to Microsoft.


Article ID:   W17268
File Created: 2007:07:03:14:29:08
Last Updated: 2007:07:03:14:29:08