vbscript regexp
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 108
Visual REGEXP 3.1
Visual REGEXP lets you easily design and debug regular expressions. more>>
Visual REGEXP project can easily design and debug regular expressions by providing a graphical visualization of the expression and its matches on a sample of your choice.
Version restrictions:
- some regexp can consume a lot of CPU time. This seems to be caused by the use of -all, -inline and -indices flags together.
- when a subexpression is not matched (empty match), the last character of the previous match are coloured. This is due to a problem in Tcl (bug submitted to Scriptics).
Enhancements:
- new version done by Martin Lemburg. Many thanks, Martin.
- it is now a tcl 8.5a4 starpack
- GUI layout changed to be based on a paned window
- GUI code looks different, to be more ergonomic
- the informational labels (replacements & matches) are now sunken
- there are now additional the "first" and "last" navigation buttons
- there is a new option to navigate through matches or matches and submatches
- the displayed count of matches is changed to display the current and the count of matches used for navigation (probably changes, if the new navigation option is changed)
- the replace widget is disabled on startup
- the tcl console is added to the help menu
- the key bindings inside the regexp text widget changed a bit to allow for expanded regexp (-expanded or (?x)) to contain tabs and newlines. Tabs are created with Control-Tab and newlines with Control-Return. Additional with Control-C|V|X (not c|v|x) it is possible to use the clipboard like with Control|Shift-Insert, Shift-Delete.
<<lessVersion restrictions:
- some regexp can consume a lot of CPU time. This seems to be caused by the use of -all, -inline and -indices flags together.
- when a subexpression is not matched (empty match), the last character of the previous match are coloured. This is due to a problem in Tcl (bug submitted to Scriptics).
Enhancements:
- new version done by Martin Lemburg. Many thanks, Martin.
- it is now a tcl 8.5a4 starpack
- GUI layout changed to be based on a paned window
- GUI code looks different, to be more ergonomic
- the informational labels (replacements & matches) are now sunken
- there are now additional the "first" and "last" navigation buttons
- there is a new option to navigate through matches or matches and submatches
- the displayed count of matches is changed to display the current and the count of matches used for navigation (probably changes, if the new navigation option is changed)
- the replace widget is disabled on startup
- the tcl console is added to the help menu
- the key bindings inside the regexp text widget changed a bit to allow for expanded regexp (-expanded or (?x)) to contain tabs and newlines. Tabs are created with Control-Tab and newlines with Control-Return. Additional with Control-C|V|X (not c|v|x) it is possible to use the clipboard like with Control|Shift-Insert, Shift-Delete.
Download (0.025MB)
Added: 2006-03-08 License: GPL (GNU General Public License) Price:
1329 downloads
ShiftJIS::Regexp 1.00
ShiftJIS::Regexp contains regular expressions in Shift-JIS. more>>
ShiftJIS::Regexp contains regular expressions in Shift-JIS.
SYNOPSIS
use ShiftJIS::Regexp qw(:all);
match($string, p{Hiragana}{2}p{Digit}{2});
match($string, pH{2}pD{2});
# these two are equivalent:
This module provides some functions to use regular expressions in Shift-JIS on the byte-oriented perl.
The legal Shift-JIS character in this module must match the following regular expression:
[x00-x7FxA1-xDF]|[x81-x9FxE0-xFC][x40-x7Ex80-xFC]
To avoid false matching in multibyte encoding, this module uses anchoring technique to ensure each matching position places at the character boundaries.
cf. perlfaq6, "How can I match strings with multibyte characters?"
Functions
re(PATTERN)
re(PATTERN, MODIFIER)
Returns a regular expression parsable by the byte-oriented perl.
PATTERN is specified as a string. MODIFIER is specified as a string. Modifiers in the following list are allowed.
i case-insensitive pattern (only for ascii alphabets)
I case-insensitive pattern (greek, cyrillic, fullwidth latin)
j hiragana-katakana-insensitive pattern (but halfwidth katakana
are not considered.)
s treat string as single line
m treat string as multiple lines
x ignore whitespace (i.e. [x20nrtf]) unless backslashed
or inside a character class; but comments are not recognized!
o once parsed (not compiled!) and the result is cached internally.
o modifier
while ( ) {
print replace($_, (perl), $1, igo);
}
is more efficient than
while ( ) {
print replace($_, (perl), $1, ig);
}
because in the latter case the pattern is parsed every time
whenever the function is called.
match(STRING, PATTERN)
match(STRING, PATTERN, MODIFIER)
An emulation of m// operator aware of Shift-JIS. But, to emulate @list = $string =~ m/PATTERN/g, the pattern should be parenthesized (capturing parentheses are not added automatically).
@list = match($string, pH, g); # wrong; returns garbage!
@list = match($string,(pH),g); # good
PATTERN is specified as a string. MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
g match globally
z tell the function the pattern matches an empty string
(sorry, due to the poor auto-detection)
replace(STRING or SCALAR REF, PATTERN, REPLACEMENT)
replace(STRING or SCALAR REF, PATTERN, REPLACEMENT, MODIFIER)
An emulation of s/// operator but aware of Shift-JIS.
If a reference to a scalar is specified as the first argument, substitutes the referent scalar and returns the number of substitutions made. If a string (not a reference) is specified as the first argument, returns the substituted string and the specified string is unaffected.
MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
g,z please see match().
jsplit(PATTERN or ARRAY REF of [PATTERN, MODIFIER], STRING)
jsplit(PATTERN or ARRAY REF of [PATTERN, MODIFIER], STRING, LIMIT)
An emulation of CORE::split but aware of Shift-JIS.
In scalar/void context, it does not split into the @_ array; in scalar context, only returns the number of fields found.
PATTERN is specified as a string. But as PATTERN has no special meaning; it splits the string on a single space similarly to CORE::split / /.
When you want to split the string on whitespace, pass an undefined value as PATTERN or use the splitspace() function.
jsplit(undef, " x81x40 This is x81x40 perl.");
splitspace(" x81x40 This is x81x40 perl.");
# (This, is, perl.)
If you want to pass pattern with modifiers, specify an arrayref of [PATTERN, MODIFIER] as the first argument. You can also use "Embedded Modifiers").
MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
splitspace(STRING)
splitspace(STRING, LIMIT)
This function emulates CORE::split( , STRING, LIMIT). It returns a list given by split STRING on whitespace including "x81x40" (IDEOGRAPHIC SPACE). Leading whitespace characters do not produce any field.
Note: splitspace(STRING, LIMIT) is equivalent to jsplit(undef, STRING, LIMIT).
splitchar(STRING)
splitchar(STRING, LIMIT)
This function emulates CORE::split(//, STRING, LIMIT). It returns a list given by split of STRING into characters.
Note: splitchar(STRING, LIMIT) is equivalent to jsplit(, STRING, LIMIT).
<<lessSYNOPSIS
use ShiftJIS::Regexp qw(:all);
match($string, p{Hiragana}{2}p{Digit}{2});
match($string, pH{2}pD{2});
# these two are equivalent:
This module provides some functions to use regular expressions in Shift-JIS on the byte-oriented perl.
The legal Shift-JIS character in this module must match the following regular expression:
[x00-x7FxA1-xDF]|[x81-x9FxE0-xFC][x40-x7Ex80-xFC]
To avoid false matching in multibyte encoding, this module uses anchoring technique to ensure each matching position places at the character boundaries.
cf. perlfaq6, "How can I match strings with multibyte characters?"
Functions
re(PATTERN)
re(PATTERN, MODIFIER)
Returns a regular expression parsable by the byte-oriented perl.
PATTERN is specified as a string. MODIFIER is specified as a string. Modifiers in the following list are allowed.
i case-insensitive pattern (only for ascii alphabets)
I case-insensitive pattern (greek, cyrillic, fullwidth latin)
j hiragana-katakana-insensitive pattern (but halfwidth katakana
are not considered.)
s treat string as single line
m treat string as multiple lines
x ignore whitespace (i.e. [x20nrtf]) unless backslashed
or inside a character class; but comments are not recognized!
o once parsed (not compiled!) and the result is cached internally.
o modifier
while ( ) {
print replace($_, (perl), $1, igo);
}
is more efficient than
while ( ) {
print replace($_, (perl), $1, ig);
}
because in the latter case the pattern is parsed every time
whenever the function is called.
match(STRING, PATTERN)
match(STRING, PATTERN, MODIFIER)
An emulation of m// operator aware of Shift-JIS. But, to emulate @list = $string =~ m/PATTERN/g, the pattern should be parenthesized (capturing parentheses are not added automatically).
@list = match($string, pH, g); # wrong; returns garbage!
@list = match($string,(pH),g); # good
PATTERN is specified as a string. MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
g match globally
z tell the function the pattern matches an empty string
(sorry, due to the poor auto-detection)
replace(STRING or SCALAR REF, PATTERN, REPLACEMENT)
replace(STRING or SCALAR REF, PATTERN, REPLACEMENT, MODIFIER)
An emulation of s/// operator but aware of Shift-JIS.
If a reference to a scalar is specified as the first argument, substitutes the referent scalar and returns the number of substitutions made. If a string (not a reference) is specified as the first argument, returns the substituted string and the specified string is unaffected.
MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
g,z please see match().
jsplit(PATTERN or ARRAY REF of [PATTERN, MODIFIER], STRING)
jsplit(PATTERN or ARRAY REF of [PATTERN, MODIFIER], STRING, LIMIT)
An emulation of CORE::split but aware of Shift-JIS.
In scalar/void context, it does not split into the @_ array; in scalar context, only returns the number of fields found.
PATTERN is specified as a string. But as PATTERN has no special meaning; it splits the string on a single space similarly to CORE::split / /.
When you want to split the string on whitespace, pass an undefined value as PATTERN or use the splitspace() function.
jsplit(undef, " x81x40 This is x81x40 perl.");
splitspace(" x81x40 This is x81x40 perl.");
# (This, is, perl.)
If you want to pass pattern with modifiers, specify an arrayref of [PATTERN, MODIFIER] as the first argument. You can also use "Embedded Modifiers").
MODIFIER is specified as a string.
i,I,j,s,m,x,o please see re().
splitspace(STRING)
splitspace(STRING, LIMIT)
This function emulates CORE::split( , STRING, LIMIT). It returns a list given by split STRING on whitespace including "x81x40" (IDEOGRAPHIC SPACE). Leading whitespace characters do not produce any field.
Note: splitspace(STRING, LIMIT) is equivalent to jsplit(undef, STRING, LIMIT).
splitchar(STRING)
splitchar(STRING, LIMIT)
This function emulates CORE::split(//, STRING, LIMIT). It returns a list given by split of STRING into characters.
Note: splitchar(STRING, LIMIT) is equivalent to jsplit(, STRING, LIMIT).
Download (0.035MB)
Added: 2007-08-08 License: Perl Artistic License Price:
811 downloads
Search::Tools::RegExp 0.06
Search::Tools::RegExp is a Perl module to build regular expressions from search queries. more>>
Search::Tools::RegExp is a Perl module to build regular expressions from search queries.
SYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $r = $kw->re( $w );
# the word itself
printf("the word is %sn", $r->word);
# is it flagged as a phrase?
print "the word is a phrasen" if $r->phrase;
# each of these are regular expressions
print $r->plain;
print $r->html;
}
Build regular expressions for a string of text.
All text is converted to UTF-8 automatically if it isnt already, via the Search:Tools::Keywords module.
<<lessSYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $r = $kw->re( $w );
# the word itself
printf("the word is %sn", $r->word);
# is it flagged as a phrase?
print "the word is a phrasen" if $r->phrase;
# each of these are regular expressions
print $r->plain;
print $r->html;
}
Build regular expressions for a string of text.
All text is converted to UTF-8 automatically if it isnt already, via the Search:Tools::Keywords module.
Download (0.048MB)
Added: 2006-10-19 License: Perl Artistic License Price:
1100 downloads
Sub::Regex 0.02
Sub::Regex is a Perl module to create synonymous subroutines. more>>
Sub::Regex is a Perl module to create synonymous subroutines.
SYNOPSIS
use Sub::Regex;
sub /look(s|ing)?_for/ ($){
foobar blah blah
}
look_for(Amanda);
looks_for(Amanda);
looking_for(Amanda);
lOoKiNg_fOr(Amanda);
Sub::Regex is a small tool for users to create a subroutine with multiple names. The only thing to be done is replace the normal name of a subroutine with a regular expression. However, regexp modifiers are not allowed, and matching is all considered case-insensitive.
<<lessSYNOPSIS
use Sub::Regex;
sub /look(s|ing)?_for/ ($){
foobar blah blah
}
look_for(Amanda);
looks_for(Amanda);
looking_for(Amanda);
lOoKiNg_fOr(Amanda);
Sub::Regex is a small tool for users to create a subroutine with multiple names. The only thing to be done is replace the normal name of a subroutine with a regular expression. However, regexp modifiers are not allowed, and matching is all considered case-insensitive.
Download (0.002MB)
Added: 2007-05-03 License: Perl Artistic License Price:
905 downloads
Regexp::Log 0.04
Regexp::Log is a Perl base class for log files regexp builders. more>>
Regexp::Log is a Perl base class for log files regexp builders.
SYNOPSIS
my $foo = Regexp::Log::Foo->new(
format => custom %a %b %c/%d,
capture => [qw( host code )],
);
# the format() and capture() methods can be used to set or get
$foo->format(custom %g %e %a %w/%s %c);
$foo->capture(qw( host code ));
# this is necessary to know in which order
# we will receive the captured fields from the regexp
my @fields = $foo->capture;
# the all-powerful capturing regexp :-)
my $re = $foo->regexp;
while () {
my %data;
@data{@fields} = /$re/; # no need for /o, its a compiled regexp
# now munge the fields
...
}
<<lessSYNOPSIS
my $foo = Regexp::Log::Foo->new(
format => custom %a %b %c/%d,
capture => [qw( host code )],
);
# the format() and capture() methods can be used to set or get
$foo->format(custom %g %e %a %w/%s %c);
$foo->capture(qw( host code ));
# this is necessary to know in which order
# we will receive the captured fields from the regexp
my @fields = $foo->capture;
# the all-powerful capturing regexp :-)
my $re = $foo->regexp;
while () {
my %data;
@data{@fields} = /$re/; # no need for /o, its a compiled regexp
# now munge the fields
...
}
Download (0.008MB)
Added: 2007-08-02 License: Perl Artistic License Price:
813 downloads
Regexp::Genex 0.07
Regexp::Genex - get the strings a regex will match, with a regex. more>>
Regexp::Genex - get the strings a regex will match, with a regex.
SYNPOSIS
# first try:
$ perl -MRegexp::Genex=:all -le print for strings(qr/a(b|c)d{2,3}e*/)
$ perl -x `pmpath Regexp::Genex`
#!/usr/bin/perl -l
use Regexp::Genex qw(:all);
$regex = shift || "a(b|c)d{2,4}?";
print "Trying: $regex";
print for strings($regex);
# abdd
# abddd
# abdddd
# acdd
# acddd
# acdddd
print "nThe regex code for that was:nqr/";
print strings_rx($regex);
print "/xn";
my $generator = generator($regex);
print "Taking first two using generator";
print $generator->() for 1..2;
my $big_rx = b*?c*?d*?; # * becomes {0,20}
my $big = generator($big_rx, ($max_length = 100) );
print "Taking string 100 of $big_rx";
print $big->(100); # (caveats below)
# ccccdddddddddddddddd NOT dx100 as you may expect
<<lessSYNPOSIS
# first try:
$ perl -MRegexp::Genex=:all -le print for strings(qr/a(b|c)d{2,3}e*/)
$ perl -x `pmpath Regexp::Genex`
#!/usr/bin/perl -l
use Regexp::Genex qw(:all);
$regex = shift || "a(b|c)d{2,4}?";
print "Trying: $regex";
print for strings($regex);
# abdd
# abddd
# abdddd
# acdd
# acddd
# acdddd
print "nThe regex code for that was:nqr/";
print strings_rx($regex);
print "/xn";
my $generator = generator($regex);
print "Taking first two using generator";
print $generator->() for 1..2;
my $big_rx = b*?c*?d*?; # * becomes {0,20}
my $big = generator($big_rx, ($max_length = 100) );
print "Taking string 100 of $big_rx";
print $big->(100); # (caveats below)
# ccccdddddddddddddddd NOT dx100 as you may expect
Download (0.008MB)
Added: 2007-08-16 License: Perl Artistic License Price:
800 downloads
Search::Tools::RegExp::Keyword 0.06
Search::Tools::RegExp::Keyword is a Perl module to access regular expressions for a keyword. more>>
Search::Tools::RegExp::Keyword is a Perl module to access regular expressions for a keyword.
SYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $re = $kw->re( $w ); # $re is S::T::R::Keyword object
# each of these are regular expressions ... suitable for framing
my $h = $re->html;
my $p = $re->plain;
unless ( $re->word =~ m/^$h$/ )
{
die "something terribly wrong with the html regexp: $h";
}
unless ( $re->word =~ m/^$p$/ )
{
die "something terribly wrong with the plain regexp: $p";
}
}
Search::Tools::RegExp::Keyword provides access to the regular expressions for a query keyword.
<<lessSYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $re = $kw->re( $w ); # $re is S::T::R::Keyword object
# each of these are regular expressions ... suitable for framing
my $h = $re->html;
my $p = $re->plain;
unless ( $re->word =~ m/^$h$/ )
{
die "something terribly wrong with the html regexp: $h";
}
unless ( $re->word =~ m/^$p$/ )
{
die "something terribly wrong with the plain regexp: $p";
}
}
Search::Tools::RegExp::Keyword provides access to the regular expressions for a query keyword.
Download (0.048MB)
Added: 2006-10-18 License: Perl Artistic License Price:
1102 downloads
JRegexpTester 0.37
JRegexpTester is a standalone Swing application. more>>
JRegexpTester is a standalone Swing application that helps you test regular expressions with the Sun Java standard API (java.util.regex).
The extracted data can be modified with formatters similar to those used by sprintf, or with standard Java date and decimal formatters. JRegexpTester features RegExLib library integration with more than 900 patterns.
Since the release 0.3, JRegexpTester helps you manage CSV (comma-separated values) files.
Main features:
- easy to use interface.
- immediate response.
- large file extraction permitted (line by line).
- automatic integration of the entire RegExLib.com library (more than 900 patterns ready to use except those .Net specific).
- save/load/export(text,html)./search
- users can easily see all the groups capturing text moving the cursor into the pane of details.
- the open-close brackets (curly and square) and parenthesis are clearly highlighted into the regexp text area.
- easy CSV file management (extract/transform). JRegexpTester can help you manage files with more than 65536 rows which cant be read entirely by Gnumeric.
Enhancements:
- integration of the new webservices of RegexLib V2 into the panel of preferences
<<lessThe extracted data can be modified with formatters similar to those used by sprintf, or with standard Java date and decimal formatters. JRegexpTester features RegExLib library integration with more than 900 patterns.
Since the release 0.3, JRegexpTester helps you manage CSV (comma-separated values) files.
Main features:
- easy to use interface.
- immediate response.
- large file extraction permitted (line by line).
- automatic integration of the entire RegExLib.com library (more than 900 patterns ready to use except those .Net specific).
- save/load/export(text,html)./search
- users can easily see all the groups capturing text moving the cursor into the pane of details.
- the open-close brackets (curly and square) and parenthesis are clearly highlighted into the regexp text area.
- easy CSV file management (extract/transform). JRegexpTester can help you manage files with more than 65536 rows which cant be read entirely by Gnumeric.
Enhancements:
- integration of the new webservices of RegexLib V2 into the panel of preferences
Download (1.9MB)
Added: 2007-04-01 License: GPL (GNU General Public License) Price:
937 downloads
Search::Tools::RegExp::Keywords 0.06
Search::Tools::RegExp::Keywords is a Perl module to access regular expressions for keywords. more>>
Search::Tools::RegExp::Keywords is a Perl module to access regular expressions for keywords.
SYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $r = $kw->re( $w );
}
Search::Tools::RegExp::Keywords provides access to the regular expressions for a query keyword.
A Search::Tools::RegExp::Keywords object is returned by the Search::Tools::RegExp build() method. This class is typically not used in isolation.
<<lessSYNOPSIS
my $regexp = Search::Tools::RegExp->new();
my $kw = $regexp->build(the quick brown fox);
for my $w ($kw->keywords)
{
my $r = $kw->re( $w );
}
Search::Tools::RegExp::Keywords provides access to the regular expressions for a query keyword.
A Search::Tools::RegExp::Keywords object is returned by the Search::Tools::RegExp build() method. This class is typically not used in isolation.
Download (0.048MB)
Added: 2006-10-18 License: Perl Artistic License Price:
1101 downloads
Regexp::Parser 0.20
Regexp::Parser is a Perl module for parsing regexes. more>>
Regexp::Parser is a Perl module for parsing regexes.
This module parses regular expressions (regexes). Its default "grammar" is Perl 5.8.4s regex set. Grammar is quoted because the module does not so much define a grammar as let each matched node state what it expects to match next, but there is not currently a way of extracting a complete grammar. This may change in future versions.
This module is designed as a replacement (though not drop-in) for my old YAPE::Regex modules.
USAGE:
Creating an Instance
To use this module as is, load it, and create an instance:
use Regexp::Parser;
my $parser = Regexp::Parser->new;
Setting a Regex
To have the parser work on a specific regex, you can do use any of the following methods:
$parser = Regexp::Parser->new($regex)
You can send the regex to be parsed as the argument to the constructor.
$parser->regex($regex)
Clears the parsers memory and sets $regex as the regex to be parsed.
These two approaches do an initial pass over the regex to make sure it is well-formed -- any warnings or errors will be determined during this initial pass.
<<lessThis module parses regular expressions (regexes). Its default "grammar" is Perl 5.8.4s regex set. Grammar is quoted because the module does not so much define a grammar as let each matched node state what it expects to match next, but there is not currently a way of extracting a complete grammar. This may change in future versions.
This module is designed as a replacement (though not drop-in) for my old YAPE::Regex modules.
USAGE:
Creating an Instance
To use this module as is, load it, and create an instance:
use Regexp::Parser;
my $parser = Regexp::Parser->new;
Setting a Regex
To have the parser work on a specific regex, you can do use any of the following methods:
$parser = Regexp::Parser->new($regex)
You can send the regex to be parsed as the argument to the constructor.
$parser->regex($regex)
Clears the parsers memory and sets $regex as the regex to be parsed.
These two approaches do an initial pass over the regex to make sure it is well-formed -- any warnings or errors will be determined during this initial pass.
Download (0.040MB)
Added: 2006-09-25 License: Perl Artistic License Price:
1125 downloads
Regexp::Ignore 0.03
Regexp::Ignore is a Perl module that let us ignore unwanted parts, while parsing text. more>>
Regexp::Ignore is a Perl module that let us ignore unwanted parts, while parsing text.
WARNING
This is an alpha code. Really. It was written in the end of 2001. It is not yet checked much. The only reason I submit it to CPAN that early is to get feedback about the idea, and hopefully to get some help in finding the many bugs that must still be in it. In our company we use this code, though, and for our needs it runs well.
SYNOPSIS
use Regexp::IgnoreXXX;
my $rei = new Regexp::IgnoreXXX($text,
"");
# split the wanted text from the unwanted text
$rei->split();
# use substitution function
$rei->s((var)_(d+), $2$1, gi);
$rei->s((d+):(d+), $2:$1);
# merge back to get the resulted text
my $changed_text = $rei->merge();
Markup languages, like HTML, are difficult to parse. The reason is that you can have a line like:
< font size=+1 >H< /font >ello < font size=+1 >W< /font >orld
How can we find the string "Hello World", in the above line, and replace it by "Hello Universe" (which is a lot deeper)? Or how can we run a speller on the text and replace the mistakes with suggestions for the correct spelling?
This module come to help you doing exactly that.
Actually the module let you first split the text to the parts you are interested in and the unwanted parts. For example, all the HTML tags can be taken as unwanted parts.
Then it let you parse the part you are interested in (while totally ignoring the unwanted parts).
In the end it let you merge back the unwanted parts with the possibly changed parts you were interested in.
There is just one catch. It uses the assumption that when you replace the above "Hello World" to "Hello Universe", all the unwanted parts between the start of the match to the end of the match, will be pushed after the text that will replace the match. This is not really understood right? Look at the example:
The text:
< font size=+1 >H< /font >ello < font size=+1 >W< /font >orld
will be first split and we will get the "cleaned" text:
Hello World
Then we can parse it using something like:
s/Hello World/Hello Universe/;
This will give us the changed "cleaned" text:
Hello Universe
When we will merge with the unwanted parts we will get
< font size=+1 >Hello Universe< /font >< font size=+1 >< /font >
So, the unwanted parts in the match were pushed after the replacer.
<<lessWARNING
This is an alpha code. Really. It was written in the end of 2001. It is not yet checked much. The only reason I submit it to CPAN that early is to get feedback about the idea, and hopefully to get some help in finding the many bugs that must still be in it. In our company we use this code, though, and for our needs it runs well.
SYNOPSIS
use Regexp::IgnoreXXX;
my $rei = new Regexp::IgnoreXXX($text,
"");
# split the wanted text from the unwanted text
$rei->split();
# use substitution function
$rei->s((var)_(d+), $2$1, gi);
$rei->s((d+):(d+), $2:$1);
# merge back to get the resulted text
my $changed_text = $rei->merge();
Markup languages, like HTML, are difficult to parse. The reason is that you can have a line like:
< font size=+1 >H< /font >ello < font size=+1 >W< /font >orld
How can we find the string "Hello World", in the above line, and replace it by "Hello Universe" (which is a lot deeper)? Or how can we run a speller on the text and replace the mistakes with suggestions for the correct spelling?
This module come to help you doing exactly that.
Actually the module let you first split the text to the parts you are interested in and the unwanted parts. For example, all the HTML tags can be taken as unwanted parts.
Then it let you parse the part you are interested in (while totally ignoring the unwanted parts).
In the end it let you merge back the unwanted parts with the possibly changed parts you were interested in.
There is just one catch. It uses the assumption that when you replace the above "Hello World" to "Hello Universe", all the unwanted parts between the start of the match to the end of the match, will be pushed after the text that will replace the match. This is not really understood right? Look at the example:
The text:
< font size=+1 >H< /font >ello < font size=+1 >W< /font >orld
will be first split and we will get the "cleaned" text:
Hello World
Then we can parse it using something like:
s/Hello World/Hello Universe/;
This will give us the changed "cleaned" text:
Hello Universe
When we will merge with the unwanted parts we will get
< font size=+1 >Hello Universe< /font >< font size=+1 >< /font >
So, the unwanted parts in the match were pushed after the replacer.
Download (0.070MB)
Added: 2007-06-29 License: Perl Artistic License Price:
847 downloads
SIPp 2.0
SIPp is a free Open Source test tool / traffic generator for the SIP protocol. more>>
SIPp is a free Open Source test tool / traffic generator for the SIP protocol. It includes a few basic SipStone user agent scenarios (UAC and UAS) and establishes and releases multiple calls with the INVITE and BYE methods.
SIPp project can also reads custom XML scenario files describing from very simple to complex call flows. It features the dynamic display of statistics about running tests (call rate, round trip delay, and message statistics), periodic CSV statistics dumps, TCP and UDP over multiple sockets or multiplexed with retransmission management and dynamically adjustable call rates.
Other advanced features include support of IPv6, TLS, SIP authentication, conditional scenarios, UDP retransmissions, error robustness (call timeout, protocol defense), call specific variable, Posix regular expression to extract and re-inject any protocol fields, custom actions (log, system command exec, call stop) on message receive, field injection from external CSV file to emulate live users.
While optimized for traffic, stress and performance testing, SIPp can be used to run one single call and exit, providing a passed/failed verdict.
Last, but not least, SIPp has a comprehensive documentation available both in HTML and PDF format.
SIPp can be used to test many real SIP equipements like SIP proxies, B2BUAs, SIP media servers, SIP/x gateways, SIP PBX, ... It is also very useful to emulate thousands of user agents calling your SIP system.
Enhancements:
- New: Statistical (conditional) branching feature. See
- http://sipp.sf.net/doc/reference.html#Randomness+in+conditional+branching.
- New: 3PCC extended mode - see
- http://sipp.sourceforge.net/doc/reference.html#3PCC+Extended
- Tool: monitor remote SIP servers through SNMP - see
- http://sipp.sourceforge.net/wiki/index.php/Getting_feedback_from_the_server
- Enh: extends the -aa option to UPDATE messages
- Enh: changes in the compilation with external libs - useful for the package
- generation system
- Enh: Allow sampling from a Weibull distribution for pause duration
- Enh: use stat_delimiter for the trace_rtt option and include number that is
- being reported.
- Enh: Add repeat_rtd keyword for repeated RTD calculations
- Enh: Handle stripping Control-M characters from multi-valued headers in
- get_header
- Enh: Update the clock_tick more frequently so that we have a higher timer and
- statistics resolution
- Enh: for option that take a time as argument - allow them to be specified using
- seconds or milliseconds
- Enh: fail when parsing a scenario that has pcap if pcap is not enabled
- Enh: print the actual location of the error log file and the error condition
- (if any) on creation
- Enh: fail when parsing a scenario that enables authentication if SSL is not
- enabled
- Enh: Makefile - include EXTRAENDLIBS keyword so that libraries can be appended
- to the list after SSL Enh: Add regexp_match argument to the receive command for
- universal catching
- Enh: remote control: increase the allowed number of control sockets.
- Enh: 3pcc extended: clean the reach of the allowed number of local twin sockets
- Enh: amelioration of statistic computing
- Enh regexp: add case_indep, occurence and start_line options for the hdr
- matching case
- Enh: Stats: Use RTDs that are precise to the microsecond in -trace_rtt, and
- improve the consistency between trace_rtt and the averages
- Enh: Only include RTDs that are actually used in the CSV output
- Enh: Allow loss percentages less than 1 and also a global command line option to
- specify that packets should be lost at a given percentage
- Fix: fix for -t un error for non-IPv6 platform like win32 - Unable to bind UDP
- socket, errno = 106 (Address family not supported by protocol)
- Fix: Do not initialize the screen library in background mode
- Fix: allow having an optional recv before a recvCmd
- Fix: Authentication: allow [fieldn] values for the [authentication] field
- Fix: updated support of short header forms
- Fix: small bug fix to the micrortt.diff which is required for the initial call
- rate to work properly
- Fix:Allow the code to compile with -Wall -Werror on Linux
- Fix: empty line was generated when [routes] keyword was used and proxy did not
- record-route
- Fix: pcap on HPUX; Fix: Simple fixes identified with valgrind
- Fix: 3pcc extended: problem when quitting
- Fix: regexp: add a warning when the specified header is not present in the
- received message
- Fix: pcap: destroy the send packets thread properly even if the sendto failed
- Fix: bug in regexp due to an incomplete commit (rev 172) - remove some debugging
- traces in message log file
- Fix: bugs on retransmission counters and on cookies for optional messages
- Fix: Incorrect branch in automatic ACK answering to unexpected >= 400 responses,
- as well as automatic CANCEL - in such cases, branch must be identical to the
- branch of the initial INVITE request
- Fix: 3pcc extended: clean up when screen exit. Fix: stop logging when the
- maximum allowed file size is reached (avoid core dump)
- Fix: incomplete Via header in automatic responses when aborting calls
- Fix: -h: -key parameter
- Fix: 3pcc/3pcc extended modes: closes twin sockets properly when twin instance
- exits, to break the poll() loop and avoid the print of empty messages
- Fix: in 3pcc/3pcc extended modes: send BYE/CANCEL before exit due to other twin
- instance exit
- Fix: force exit when pressing q twice (Q press can still be used)
- Fix: Aka authentication for synchro case, also added password len as password
- for authentication might contain char Fix: possible core dump in SDP parser
- Fix: accept up to the 5 defined RTDs (previously would only accept one less)
- Fix: Fail if there is an invalid repartition table specification - previous
- behavior was a core dump
- Fix: added -users option to the parameter table
- Fix: change option description to match timed options
- Fix: trace_err did not work in background mode
- Fix: bug when testing the presence of the 3PCC compilation flag
- Fix: bug in -r -rp option
<<lessSIPp project can also reads custom XML scenario files describing from very simple to complex call flows. It features the dynamic display of statistics about running tests (call rate, round trip delay, and message statistics), periodic CSV statistics dumps, TCP and UDP over multiple sockets or multiplexed with retransmission management and dynamically adjustable call rates.
Other advanced features include support of IPv6, TLS, SIP authentication, conditional scenarios, UDP retransmissions, error robustness (call timeout, protocol defense), call specific variable, Posix regular expression to extract and re-inject any protocol fields, custom actions (log, system command exec, call stop) on message receive, field injection from external CSV file to emulate live users.
While optimized for traffic, stress and performance testing, SIPp can be used to run one single call and exit, providing a passed/failed verdict.
Last, but not least, SIPp has a comprehensive documentation available both in HTML and PDF format.
SIPp can be used to test many real SIP equipements like SIP proxies, B2BUAs, SIP media servers, SIP/x gateways, SIP PBX, ... It is also very useful to emulate thousands of user agents calling your SIP system.
Enhancements:
- New: Statistical (conditional) branching feature. See
- http://sipp.sf.net/doc/reference.html#Randomness+in+conditional+branching.
- New: 3PCC extended mode - see
- http://sipp.sourceforge.net/doc/reference.html#3PCC+Extended
- Tool: monitor remote SIP servers through SNMP - see
- http://sipp.sourceforge.net/wiki/index.php/Getting_feedback_from_the_server
- Enh: extends the -aa option to UPDATE messages
- Enh: changes in the compilation with external libs - useful for the package
- generation system
- Enh: Allow sampling from a Weibull distribution for pause duration
- Enh: use stat_delimiter for the trace_rtt option and include number that is
- being reported.
- Enh: Add repeat_rtd keyword for repeated RTD calculations
- Enh: Handle stripping Control-M characters from multi-valued headers in
- get_header
- Enh: Update the clock_tick more frequently so that we have a higher timer and
- statistics resolution
- Enh: for option that take a time as argument - allow them to be specified using
- seconds or milliseconds
- Enh: fail when parsing a scenario that has pcap if pcap is not enabled
- Enh: print the actual location of the error log file and the error condition
- (if any) on creation
- Enh: fail when parsing a scenario that enables authentication if SSL is not
- enabled
- Enh: Makefile - include EXTRAENDLIBS keyword so that libraries can be appended
- to the list after SSL Enh: Add regexp_match argument to the receive command for
- universal catching
- Enh: remote control: increase the allowed number of control sockets.
- Enh: 3pcc extended: clean the reach of the allowed number of local twin sockets
- Enh: amelioration of statistic computing
- Enh regexp: add case_indep, occurence and start_line options for the hdr
- matching case
- Enh: Stats: Use RTDs that are precise to the microsecond in -trace_rtt, and
- improve the consistency between trace_rtt and the averages
- Enh: Only include RTDs that are actually used in the CSV output
- Enh: Allow loss percentages less than 1 and also a global command line option to
- specify that packets should be lost at a given percentage
- Fix: fix for -t un error for non-IPv6 platform like win32 - Unable to bind UDP
- socket, errno = 106 (Address family not supported by protocol)
- Fix: Do not initialize the screen library in background mode
- Fix: allow having an optional recv before a recvCmd
- Fix: Authentication: allow [fieldn] values for the [authentication] field
- Fix: updated support of short header forms
- Fix: small bug fix to the micrortt.diff which is required for the initial call
- rate to work properly
- Fix:Allow the code to compile with -Wall -Werror on Linux
- Fix: empty line was generated when [routes] keyword was used and proxy did not
- record-route
- Fix: pcap on HPUX; Fix: Simple fixes identified with valgrind
- Fix: 3pcc extended: problem when quitting
- Fix: regexp: add a warning when the specified header is not present in the
- received message
- Fix: pcap: destroy the send packets thread properly even if the sendto failed
- Fix: bug in regexp due to an incomplete commit (rev 172) - remove some debugging
- traces in message log file
- Fix: bugs on retransmission counters and on cookies for optional messages
- Fix: Incorrect branch in automatic ACK answering to unexpected >= 400 responses,
- as well as automatic CANCEL - in such cases, branch must be identical to the
- branch of the initial INVITE request
- Fix: 3pcc extended: clean up when screen exit. Fix: stop logging when the
- maximum allowed file size is reached (avoid core dump)
- Fix: incomplete Via header in automatic responses when aborting calls
- Fix: -h: -key parameter
- Fix: 3pcc/3pcc extended modes: closes twin sockets properly when twin instance
- exits, to break the poll() loop and avoid the print of empty messages
- Fix: in 3pcc/3pcc extended modes: send BYE/CANCEL before exit due to other twin
- instance exit
- Fix: force exit when pressing q twice (Q press can still be used)
- Fix: Aka authentication for synchro case, also added password len as password
- for authentication might contain char Fix: possible core dump in SDP parser
- Fix: accept up to the 5 defined RTDs (previously would only accept one less)
- Fix: Fail if there is an invalid repartition table specification - previous
- behavior was a core dump
- Fix: added -users option to the parameter table
- Fix: change option description to match timed options
- Fix: trace_err did not work in background mode
- Fix: bug when testing the presence of the 3PCC compilation flag
- Fix: bug in -r -rp option
Download (0.18MB)
Added: 2007-04-27 License: GPL (GNU General Public License) Price:
926 downloads
Regexp::Extended 0.01
Regexp::Extended is a Perl wrapper that extends the re module with new features. more>>
Regexp::Extended is a Perl wrapper that extends the re module with new features.
SYNOPSIS
use Regexp::Extended qw(:all);
# (?...): named parameters
$date =~ /(? d+)-(? d+)-(? d+)/;
if ("2002-10-30" =~ /$date/) {
print "The date is : $::year->[0]-$::month->[0]-$::day->[0]n";
}
# You can also access individial matches in ()* or ()+
"1234" =~ /(? d)+/;
print "Digit 1 is : $::digit->[0]n";
print "Digit 2 is : $::digit->[1]n";
...
# You can also modify individual matches
"1234" =~ /(? d)+/;
$::digit->[0] = 99;
$::digit->[1] = 88;
print "Modified string is: " . rebuild("1234"); # "998834"
# (?*...): upto a certain pattern
$text = "this is some italic text";
$text =~ /((?*)) /; # $1 = "italic"
# (?+...): upto and including a certain pattern
$text = "this is some italic text";
$text =~ /((?+))/; # $1 = "italic"
# You can also use fonctions inside patterns:
sub foo {
return "foo";
}
"foo bar" =~ /((?&foo()))/; # $1 => "foo"
Rexexp::Extended is a simple wrapper arround the perl rexexp syntax. It uses the overload module to parse constant qr// expressions and substitute known operators with an equivalent perl re.
<<lessSYNOPSIS
use Regexp::Extended qw(:all);
# (?...): named parameters
$date =~ /(? d+)-(? d+)-(? d+)/;
if ("2002-10-30" =~ /$date/) {
print "The date is : $::year->[0]-$::month->[0]-$::day->[0]n";
}
# You can also access individial matches in ()* or ()+
"1234" =~ /(? d)+/;
print "Digit 1 is : $::digit->[0]n";
print "Digit 2 is : $::digit->[1]n";
...
# You can also modify individual matches
"1234" =~ /(? d)+/;
$::digit->[0] = 99;
$::digit->[1] = 88;
print "Modified string is: " . rebuild("1234"); # "998834"
# (?*...): upto a certain pattern
$text = "this is some italic text";
$text =~ /((?*)) /; # $1 = "italic"
# (?+...): upto and including a certain pattern
$text = "this is some italic text";
$text =~ /((?+))/; # $1 = "italic"
# You can also use fonctions inside patterns:
sub foo {
return "foo";
}
"foo bar" =~ /((?&foo()))/; # $1 => "foo"
Rexexp::Extended is a simple wrapper arround the perl rexexp syntax. It uses the overload module to parse constant qr// expressions and substitute known operators with an equivalent perl re.
Download (0.005MB)
Added: 2007-04-03 License: Perl Artistic License Price:
934 downloads
Regexp::Assemble 0.28
Regexp::Assemble is Perl module to assemble multiple Regular Expressions into a single RE. more>>
Regexp::Assemble is Perl module to assemble multiple Regular Expressions into a single RE.
SYNOPSIS
use Regexp::Assemble;
my $ra = Regexp::Assemble->new;
$ra->add( ab+c );
$ra->add( ab+- );
$ra->add( awd+ );
$ra->add( ad+ );
print $ra->re; # prints a(?:w?d+|b+[-c])
Regexp::Assemble takes an arbitrary number of regular expressions and assembles them into a single regular expression (or RE) that matches all that the individual REs match.
As a result, instead of having a large list of expressions to loop over, a target string only needs to be tested against one expression. This is interesting when you have several thousand patterns to deal with. Serious effort is made to produce the smallest pattern possible.
It is also possible to track the original patterns, so that you can determine which, among the source patterns that form the assembled pattern, was the one that caused the match to occur.
You should realise that large numbers of alternations are processed in perls regular expression engine in O(n) time, not O(1). If you are still having performance problems, you should look at using a trie. Note that Perls own regular expression engine will implement trie optimisations in perl 5.10 (they are already available in perl 5.9.3 if you want to try them out). Regexp::Assemble will do the right thing when it knows its running on a a tried perl. (At least in some version after this one).
<<lessSYNOPSIS
use Regexp::Assemble;
my $ra = Regexp::Assemble->new;
$ra->add( ab+c );
$ra->add( ab+- );
$ra->add( awd+ );
$ra->add( ad+ );
print $ra->re; # prints a(?:w?d+|b+[-c])
Regexp::Assemble takes an arbitrary number of regular expressions and assembles them into a single regular expression (or RE) that matches all that the individual REs match.
As a result, instead of having a large list of expressions to loop over, a target string only needs to be tested against one expression. This is interesting when you have several thousand patterns to deal with. Serious effort is made to produce the smallest pattern possible.
It is also possible to track the original patterns, so that you can determine which, among the source patterns that form the assembled pattern, was the one that caused the match to occur.
You should realise that large numbers of alternations are processed in perls regular expression engine in O(n) time, not O(1). If you are still having performance problems, you should look at using a trie. Note that Perls own regular expression engine will implement trie optimisations in perl 5.10 (they are already available in perl 5.9.3 if you want to try them out). Regexp::Assemble will do the right thing when it knows its running on a a tried perl. (At least in some version after this one).
Download (0.080MB)
Added: 2007-04-03 License: Perl Artistic License Price:
935 downloads
Parse::RandGen::Regexp 0.202
Parse::RandGen::Regexp is a Perl module for regular expression Condition element. more>>
Parse::RandGen::Regexp is a Perl module for regular expression Condition element.
Regexp is a Condition element that matches the given compiled regular expression. For picking random data, the regular expression is parsed into its component Subrules, Literals, CharClasses, etc.... Therefore, the pick functionality for a regular expression is ultimately the same as the pick functionality of a Rule (including the limitations w/r to greediness - see Rule).
Regexp is also useful as a standalone class. It supports captures (named and indexed), which can be referenced in a call to the pick() function to force the captures to match the specified data, while leaving the rest of the data to be generated randomly.
METHODS
new
Creates a new Regexp. The first argument (required) is the regular expression element (e.g. qr/foo(bar|baz)+d{1,10}/). All other arguments are named pairs.
element
Returns the Regexp element (i.e. the compiled regular expression itself).
numCaptures
Returns the number of captures (e.g. $1, $2, ...$n) in the regular expression.
nameCapture
Give names to capture numbers for the regular expression. The arguments to this function are capture# => "name" pairs (e.g. nameCapture(1=>"directory", 2=>"file", 3=>"extension")).
capture
Returns the Rule object that represents the specified capture. The capture can be specified by number or by name (the name is set by the nameCapture() function).
pick
Randomly generate data (text) that matches (or does not) this regular expression.
Takes a "match" boolean argument that specifies whether to match the regular expression or deliberately not match it.
Also takes a "captures" hash argument that has pairs of capture numbers (or names) and their desired value. This allows the generated data to have user-specified constraints while allowing the rest of the regular expression to choose random data. If "match" is false, the user-specified "captures" values are still used (which may cause the data to match even though it was not supposed to).
Example:
$re->pick(match=>1,
captures=>{ 1=>"http", 2=>"www", 3=>"yahoo", 4=>"com" });
<<lessRegexp is a Condition element that matches the given compiled regular expression. For picking random data, the regular expression is parsed into its component Subrules, Literals, CharClasses, etc.... Therefore, the pick functionality for a regular expression is ultimately the same as the pick functionality of a Rule (including the limitations w/r to greediness - see Rule).
Regexp is also useful as a standalone class. It supports captures (named and indexed), which can be referenced in a call to the pick() function to force the captures to match the specified data, while leaving the rest of the data to be generated randomly.
METHODS
new
Creates a new Regexp. The first argument (required) is the regular expression element (e.g. qr/foo(bar|baz)+d{1,10}/). All other arguments are named pairs.
element
Returns the Regexp element (i.e. the compiled regular expression itself).
numCaptures
Returns the number of captures (e.g. $1, $2, ...$n) in the regular expression.
nameCapture
Give names to capture numbers for the regular expression. The arguments to this function are capture# => "name" pairs (e.g. nameCapture(1=>"directory", 2=>"file", 3=>"extension")).
capture
Returns the Rule object that represents the specified capture. The capture can be specified by number or by name (the name is set by the nameCapture() function).
pick
Randomly generate data (text) that matches (or does not) this regular expression.
Takes a "match" boolean argument that specifies whether to match the regular expression or deliberately not match it.
Also takes a "captures" hash argument that has pairs of capture numbers (or names) and their desired value. This allows the generated data to have user-specified constraints while allowing the rest of the regular expression to choose random data. If "match" is false, the user-specified "captures" values are still used (which may cause the data to match even though it was not supposed to).
Example:
$re->pick(match=>1,
captures=>{ 1=>"http", 2=>"www", 3=>"yahoo", 4=>"com" });
Download (0.025MB)
Added: 2006-12-19 License: Perl Artistic License Price:
1039 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above vbscript regexp search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed