Hello,
I am searching all over the place for this, just not finding anything solid :(
I want to do be able to access the groups that are matched with grep (either with extended regex, or perl compatible regex). For instance:
echo "abcd" | egrep "a(b(c(d)))"
Of course this returns... (1 Reply)
Hi all
I am struggling to find out the capturing regex of a date format such as 10/12/2009. Also I need help on how to assign the date(i.e, 10/12/2009 ) to a variable after the match is found using the capturing regex.
Any help is appreciated. Thanks in advance. (5 Replies)
Hi all
I need help on how to store two or more date formates captured using regex from an input sentence in PERL ? For example, I have an input sentence consisting of two dates such as :
The departure date is August 12, 2009 and arrival date is 20.08.2009.
Now, I want to capture the two... (4 Replies)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
I have a requirement - replace specified positions in a string with a character. I found perl regex useful for this approach. however, I am facing the following issue.
The target file 'temp' contains -
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The goal is to convert... (5 Replies)
Hello,
Although I have found similar questions, I could not find
advice that could help with my problem. The issue:
I am trying to replace all occurrences of a regex, but
I cannot make the regex groups work together.
This is a simple input test file:
The Vedanta Philosophy... (3 Replies)
I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header.
In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
I'm trying to get some exclusions into our sendmail regular expression for the K command. The following configuration & regex works:
LOCAL_CONFIG
#
Kcheckaddress regex -a@MATCH
+<@+?\.++?\.(us|info|to|br|bid|cn|ru)
LOCAL_RULESETS
SLocal_check_mail
# check address against various regex... (0 Replies)
Discussion started by: RobbieTheK
0 Replies
LEARN ABOUT OSX
modperl::code
ModPerl::Code(3) User Contributed Perl Documentation ModPerl::Code(3)NAME
$class::Const - Perl Interface for $class Constants
SYNOPSIS CONSTANTS
EOF
my $groups = $data{$class};
for my $group (sort keys %$groups) {
print $fh <<"EOF";
":$group"
use $class::Const -compile qw(:$group);
The ":$group" group is for XXX constants.
EOF
for my $const (sort @{ $groups->{$group} }) {
print $fh "=head3 C<$class::$const>
";
}
}
print $fh "=cut
";
}
}
sub generate_constants_lookup_doc {
my ($data) = @_;
while (my ($class, $groups) = each %$Apache2::ConstantsTable) {
my $constants = [map { @$_ } values %$groups];
constants_lookup_code_doc($constants, $class, $data);
}
}
sub generate_constants_group_lookup_doc {
my ($data) = @_;
while (my ($class, $groups) = each %$Apache2::ConstantsTable) {
constants_group_lookup_code_doc($class, $groups, $data);
}
}
sub constants_group_lookup_code_doc {
my ($class, $groups, $data) = @_;
my @tags;
my @code;
while (my ($group, $constants) = each %$groups) {
$data->{$class}{$group} = [
map {
my @ifdef = constants_ifdef($_);
s/^($constant_prefixes)_?//o;
$seen_const{$class}{$_}++;
$_;
} @$constants
];
}
}
sub constants_lookup_code_doc {
my ($constants, $class, $data) = @_;
my (%switch, %alias);
%alias = %shortcuts;
my $postfix = lc $class;
my $package = $class . '::';
my $package_len = length $package;
my $func = canon_func(qw(constants lookup), $postfix);
for (@$constants) {
if (s/^($constant_prefixes)(_)?//o) {
$alias{$_} = join $2 || "", $1, $_;
}
else {
$alias{$_} ||= $_;
}
next unless /^([A-Z])/;
push @{ $switch{$1} }, $_;
}
for my $key (sort keys %switch) {
my $names = $switch{$key};
for my $name (@$names) {
my @ifdef = constants_ifdef($alias{$name});
push @{ $data->{$class}{other} }, $name
unless $seen_const{$class}{$name}
}
}
}
sub generate_exports {
my ($self, $c_fh) = @_;
require ModPerl::WrapXS;
ModPerl::WrapXS->generate_exports($c_fh); }
# src/modules/perl/*.c files needed to build APR/APR::* outside # of mod_perl.so sub src_apr_ext {
return map { "modperl_$_" } (qw(error bucket),
map { "common_$_" } qw(util log)); }
1; __END__
NAME
ModPerl::Code - Generate mod_perl glue code
SYNOPSIS
use ModPerl::Code ();
my $code = ModPerl::Code->new;
$code->generate;
DESCRIPTION
This module provides functionality for generating mod_perl glue code. Reason this code is generated rather than written by hand include:
consistency
thin and clean glue code
enable/disable features (without #ifdefs)
adapt to changes in Apache
experiment with different approaches to gluing
AUTHOR
Doug MacEachern
perl v5.16.2 2011-02-07 ModPerl::Code(3)