regexp tester
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 163
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
Firewall Tester 1.0
The Firewall Tester (FTester) is a tool designed for testing firewalls filtering policies and Intrusion Detection System (IDS) c more>>
The Firewall Tester (FTester) is a tool designed for testing firewalls filtering policies and Intrusion Detection System (IDS) capabilities.The tool consists of two perl scripts, a packet injector (ftest) and the listening sniffer (ftestd). The first script injects custom packets, defined in ftest.conf, with a signature in the data part while the sniffer listens for such marked packets. The scripts both write a log file which is in the same form for both scripts. A diff of the two produced files (ftest.log and ftestd.log) shows the packets that were unable to reach the sniffer due to filtering rules if these two scripts are ran on hosts placed on two different sides of a firewall. Stateful inspection firewalls are handled with the connection spoofing option. A script called freport is also available for automatically write to log files.
Of course this is not an automated process, ftest.conf must be crafted for every different situation. Examples and rules are included in the attached configuration file.
The IDS (Intrusion Detection System) testing feature can be used either with ftest only or with the additional support of ftestd for handling stateful inspection IDS, ftest can also use common IDS evasion techniques. Instead of using the configuration syntax currently the script can also process snort rule definition file.
These two scripts were written because I was tired of doing this by hand (with packet-crafting tools and tcpdump), I know that there are at least two dozens of other methods to do this but another reason was to learn some perl ;). I hope that you enjoy them.
Main features:
- firewall testing
- IDS testing
- simulation of real tcp connections for stateful inspection firewalls and IDS
- connection spoofing
- IP fragmentation / TCP segmentation
- IDS evasion techniques
<<lessOf course this is not an automated process, ftest.conf must be crafted for every different situation. Examples and rules are included in the attached configuration file.
The IDS (Intrusion Detection System) testing feature can be used either with ftest only or with the additional support of ftestd for handling stateful inspection IDS, ftest can also use common IDS evasion techniques. Instead of using the configuration syntax currently the script can also process snort rule definition file.
These two scripts were written because I was tired of doing this by hand (with packet-crafting tools and tcpdump), I know that there are at least two dozens of other methods to do this but another reason was to learn some perl ;). I hope that you enjoy them.
Main features:
- firewall testing
- IDS testing
- simulation of real tcp connections for stateful inspection firewalls and IDS
- connection spoofing
- IP fragmentation / TCP segmentation
- IDS evasion techniques
Download (0.030MB)
Added: 2006-07-07 License: GPL (GNU General Public License) Price:
1206 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::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::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
FTester 1.0
FTester (The Firewall Tester) is a tool designed for testing firewalls filtering policies and Intrusion Detection System (IDS). more>>
FTester (The Firewall Tester) is a tool designed for testing firewalls filtering policies and Intrusion Detection System (IDS) capabilities.
The tool consists of two perl scripts, a packet injector (ftest) and the listening sniffer (ftestd). The first script injects custom packets, defined in ftest.conf, with a signature in the data part while the sniffer listens for such marked packets. The scripts both write a log file which is in the same form for both scripts. A diff of the two produced files (ftest.log and ftestd.log) shows the packets that were unable to reach the sniffer due to filtering rules if these two scripts are ran on hosts placed on two different sides of a firewall. Stateful inspection firewalls are handled with the connection spoofing option. A script called freport is also available for automatically parse the log files.
Of course this is not an automated process, ftest.conf must be crafted for every different situation. Examples and rules are included in the attached configuration file.
The IDS (Intrusion Detection System) testing feature can be used either with ftest only or with the additional support of ftestd for handling stateful inspection IDS, ftest can also use common IDS evasion techniques. Instead of using the configuration syntax currently the script can also process snort rule definition file.
These two scripts were written because I was tired of doing this by hand (with packet-crafting tools and tcpdump), I know that there are at least two dozens of other methods to do this but another reason was to learn some perl ;). I hope that you enjoy them.
Main features:
- firewall testing
- IDS testing
- simulation of real tcp connections for stateful inspection firewalls and IDS
- connection spoofing
- IP fragmentation / TCP segmentation
- IDS evasion techniques
<<lessThe tool consists of two perl scripts, a packet injector (ftest) and the listening sniffer (ftestd). The first script injects custom packets, defined in ftest.conf, with a signature in the data part while the sniffer listens for such marked packets. The scripts both write a log file which is in the same form for both scripts. A diff of the two produced files (ftest.log and ftestd.log) shows the packets that were unable to reach the sniffer due to filtering rules if these two scripts are ran on hosts placed on two different sides of a firewall. Stateful inspection firewalls are handled with the connection spoofing option. A script called freport is also available for automatically parse the log files.
Of course this is not an automated process, ftest.conf must be crafted for every different situation. Examples and rules are included in the attached configuration file.
The IDS (Intrusion Detection System) testing feature can be used either with ftest only or with the additional support of ftestd for handling stateful inspection IDS, ftest can also use common IDS evasion techniques. Instead of using the configuration syntax currently the script can also process snort rule definition file.
These two scripts were written because I was tired of doing this by hand (with packet-crafting tools and tcpdump), I know that there are at least two dozens of other methods to do this but another reason was to learn some perl ;). I hope that you enjoy them.
Main features:
- firewall testing
- IDS testing
- simulation of real tcp connections for stateful inspection firewalls and IDS
- connection spoofing
- IP fragmentation / TCP segmentation
- IDS evasion techniques
Download (0.030MB)
Added: 2007-02-14 License: GPL (GNU General Public License) Price:
994 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
regular expression parser 1.1
regular expression parser is a C++ regexp parser that accomplishes The Open Group specification Issue 6. more>>
regular expression parser is a C++ regexp parser that accomplishes The Open Group specification Issue 6, IEEE Std 1003.1, 2004 Edition.
regular expression parser allows you to parse input using regular expressions, and to retrieve parsed sub-expression matches in a few steps.
<<lessregular expression parser allows you to parse input using regular expressions, and to retrieve parsed sub-expression matches in a few steps.
Download (0.33MB)
Added: 2006-11-27 License: GPL (GNU General Public License) Price:
624 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
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
Regexp::MatchContext 0.0.2
Regexp::MatchContext is Perl module to replace (and improve) $MATCH, $PREMATCH, and $POSTMATCH more>>
Regexp::MatchContext is Perl module to replace (and improve) $MATCH, $PREMATCH, and $POSTMATCH
SYNOPSIS
use Regexp::MatchContext -vars;
$str = m/(?p) d+ /;
print "Before: $PREMATCHn";
print "Matched: $MATCHn";
print "After: $POSTMATCHn";
$MATCH = 2 * $MATCH; # substitute into original $str
The English.pm module provides named aliases for Perls built-in $`, $& and $ variables: $PREMATCH, $MATCH, and $POSTMATCH. Unfortunately, those aliases suffer the same problems as their originals: they degrade the performance of every single regex in your program, even if youre only using them to get information about a single match.
This module also provides $PREMATCH, $MATCH, and $POSTMATCH, but in a way that only impacts the performance of matches that you specify. That is, these three variables are only set if the most recently matched regex contained the special (non-standard) meta- flag: (?p).
That is:
use Regexp::MatchContext -vars;
$str = foobarbaz;
$str =~ /(?p) foo /x;
# $PREMATCH contains foo
# $MATCH contains bar
# $POSTMATCH contains baz
$str =~ / foo /x;
# $PREMATCH, $MATCH, and $POSTMATCH all undef
The (?p) marker can be placed anywhere within the regex and, except for setting the three context variables on a successful match, is otherwise totally ignored.
<<lessSYNOPSIS
use Regexp::MatchContext -vars;
$str = m/(?p) d+ /;
print "Before: $PREMATCHn";
print "Matched: $MATCHn";
print "After: $POSTMATCHn";
$MATCH = 2 * $MATCH; # substitute into original $str
The English.pm module provides named aliases for Perls built-in $`, $& and $ variables: $PREMATCH, $MATCH, and $POSTMATCH. Unfortunately, those aliases suffer the same problems as their originals: they degrade the performance of every single regex in your program, even if youre only using them to get information about a single match.
This module also provides $PREMATCH, $MATCH, and $POSTMATCH, but in a way that only impacts the performance of matches that you specify. That is, these three variables are only set if the most recently matched regex contained the special (non-standard) meta- flag: (?p).
That is:
use Regexp::MatchContext -vars;
$str = foobarbaz;
$str =~ /(?p) foo /x;
# $PREMATCH contains foo
# $MATCH contains bar
# $POSTMATCH contains baz
$str =~ / foo /x;
# $PREMATCH, $MATCH, and $POSTMATCH all undef
The (?p) marker can be placed anywhere within the regex and, except for setting the three context variables on a successful match, is otherwise totally ignored.
Download (0.005MB)
Added: 2007-01-26 License: Perl Artistic License Price:
1001 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
Regexp::Parser::Handlers 0.20
Regexp::Parser::Handlers is a Perl module with handlers for Perl 5 regexes. more>>
Regexp::Parser::Handlers is a Perl module with handlers for Perl 5 regexes.
This module holds the init() method for the Regexp::Parser class, which installs all the handlers for standard Perl 5 regexes. This documentation contains a sub-classing tutorial.
SUB-CLASSING
I will present two example sub-classes, Regexp::NoCode, and Regexp::AndBranch.
Parser Internals
The parser object is a hash reference with the following keys:
regex
A reference to the original string representation of the regex.
len
The length of the original string representation of the regex.
tree
During the first pass, tree is undef, which instructs the object() method not to actually create any objects. Afterwards, it is an array reference of (node) objects.
stack
Initially an array reference, used to store the tree as a new scope is entered and then exited. The general concept is:
if (into_scope) {
push STACK, TREE;
TREE = CURRENT->DATA;
}
if (outof_scope) {
TREE = pop STACK;
}
After the tree has been created, this key is deleted; this gives the code a way to be sure compilation was successful.
maxpar
The highest number of parentheses. It will end up being identical to nparen, but it is incremented during the initial pass, so that on the second pass (the tree-building), it can distinguish back-references from octal escapes. (The source code to Perls regex compiler does the same thing.)
nparen
The number of OPENs (capturing groups) in the regex.
captures
An array reference to the open nodes.
flags
An array reference of flag values. When a scope is entered, the top value is copied and pushed onto the stack. When a scope is left, the top value is popped and discarded.
It is important to do this copy-and-push before you do any flag-parsing, if youre adding a handle that might parse flags, because you do not want to accidentally affect the previous scopes flag values.
Here is example code from the handler for (?ismx) and (?ismx:...):
# (?i:...) {next} }, qw< c) atom >;
}
for (split //, $on) {
if (my $h = $S->can("FLAG_$_")) {
my $v = $h->(1); # 1 means this is on
if ($v) { &Rf |= $v } # turn the flag on
else { ... } # the flags value is 0
next;
}
# throw an error if the flag isnt supported
}
for (map "FLAG_$_", split //, $off) {
if (my $h = $S->can("FLAG_$_")) {
my $v = $h->(0); # 0 means this is off
if ($v) { &Rf &= ~$v } # turn the flag off
else { ... } # the flags value is 0
next;
}
# throw an error if the flag isnt supported
}
Youll probably not be adding handlers that have to parse flags, but if you do, remember to follow this model correctly.
next
An array reference of what handles (or "rules") to try to match next.
<<lessThis module holds the init() method for the Regexp::Parser class, which installs all the handlers for standard Perl 5 regexes. This documentation contains a sub-classing tutorial.
SUB-CLASSING
I will present two example sub-classes, Regexp::NoCode, and Regexp::AndBranch.
Parser Internals
The parser object is a hash reference with the following keys:
regex
A reference to the original string representation of the regex.
len
The length of the original string representation of the regex.
tree
During the first pass, tree is undef, which instructs the object() method not to actually create any objects. Afterwards, it is an array reference of (node) objects.
stack
Initially an array reference, used to store the tree as a new scope is entered and then exited. The general concept is:
if (into_scope) {
push STACK, TREE;
TREE = CURRENT->DATA;
}
if (outof_scope) {
TREE = pop STACK;
}
After the tree has been created, this key is deleted; this gives the code a way to be sure compilation was successful.
maxpar
The highest number of parentheses. It will end up being identical to nparen, but it is incremented during the initial pass, so that on the second pass (the tree-building), it can distinguish back-references from octal escapes. (The source code to Perls regex compiler does the same thing.)
nparen
The number of OPENs (capturing groups) in the regex.
captures
An array reference to the open nodes.
flags
An array reference of flag values. When a scope is entered, the top value is copied and pushed onto the stack. When a scope is left, the top value is popped and discarded.
It is important to do this copy-and-push before you do any flag-parsing, if youre adding a handle that might parse flags, because you do not want to accidentally affect the previous scopes flag values.
Here is example code from the handler for (?ismx) and (?ismx:...):
# (?i:...) {next} }, qw< c) atom >;
}
for (split //, $on) {
if (my $h = $S->can("FLAG_$_")) {
my $v = $h->(1); # 1 means this is on
if ($v) { &Rf |= $v } # turn the flag on
else { ... } # the flags value is 0
next;
}
# throw an error if the flag isnt supported
}
for (map "FLAG_$_", split //, $off) {
if (my $h = $S->can("FLAG_$_")) {
my $v = $h->(0); # 0 means this is off
if ($v) { &Rf &= ~$v } # turn the flag off
else { ... } # the flags value is 0
next;
}
# throw an error if the flag isnt supported
}
Youll probably not be adding handlers that have to parse flags, but if you do, remember to follow this model correctly.
next
An array reference of what handles (or "rules") to try to match next.
Download (0.040MB)
Added: 2006-10-13 License: Perl Artistic License Price:
1107 downloads
QUnitTester 0.2
QUnitTester is a Qt4 binary unit tester. more>>
QUnitTester is a Qt4 binary unit tester.
Everyone who uses JUnitTesting knows about the "green bar". Qt has great possibilities for Unit Testing but i missed the green bar.
If you want to know more about Unit Testing in Qt take a look at: http://doc.trolltech.com/4.2/qtestlib-manual.html
and http://doc.trolltech.com/4.2/qtestlib-tutorial.html
The software doesnt much yet. It only runs all tests...
INSTALL:
qmake (from qt 4, in (k)ubuntu for example qmake-qt4)
make
as root: make install
USAGE:
Write your testclass and compile it. Start the program and click on Test Binary...
Choose the compiled binary.
Click on start.
Enhancements:
- Possibility to use options
- Select test(s) to run
<<lessEveryone who uses JUnitTesting knows about the "green bar". Qt has great possibilities for Unit Testing but i missed the green bar.
If you want to know more about Unit Testing in Qt take a look at: http://doc.trolltech.com/4.2/qtestlib-manual.html
and http://doc.trolltech.com/4.2/qtestlib-tutorial.html
The software doesnt much yet. It only runs all tests...
INSTALL:
qmake (from qt 4, in (k)ubuntu for example qmake-qt4)
make
as root: make install
USAGE:
Write your testclass and compile it. Start the program and click on Test Binary...
Choose the compiled binary.
Click on start.
Enhancements:
- Possibility to use options
- Select test(s) to run
Download (0.027MB)
Added: 2007-04-08 License: GPL (GNU General Public License) Price:
929 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
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 regexp tester 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