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 position 3 and 4 with '55'. Following is the script-
however on running it, it interprets the \1$value as \155, and replaces nothing.
Could you please suggest what can be done?
Last edited by Franklin52; 06-23-2011 at 03:48 AM..
Reason: Please use code tags, thank you
Hello
A couple of weeks ago, I added a user to an AIX 5.3 system.
I go to add one today, and it appears that when creating a user in smit, I cannot see any groups.
No primary groups
No Group set
No Admin Groups
The /etc/group and etc/secuity/group files seem to be intact.
I did... (4 Replies)
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)
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)
Must I be in a group? I am using Ubuntu and am the only user on my PC. I know how to change groups but do not see a way to not be in a group. Any help would be appreciated. (2 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 having trouble with regex capturing groups, For Ex :
I am having a file with
ABC CDLF SFSDFK PRIMARY INDEX(XYZ,DEF,GHI);
XYZ FLJ SDFKLD; PRIMARY INDEX(ABC);
BHI SDKFLFLSFD PRIMARY INDEX (QWE , RTY , LHJ);
My output should be :
ABC XYZ,DEF,GHI
XYZ ABC
BHI ... (10 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 DEBIAN
courier::filter::logger::syslog
Courier::Filter::Logger::Syslog(3pm) User Contributed Perl Documentation Courier::Filter::Logger::Syslog(3pm)NAME
Courier::Filter::Logger::Syslog - Syslog logger for the Courier::Filter framework
SYNOPSIS
use Courier::Filter::Logger::Syslog;
my $logger = Courier::Filter::Logger::Syslog->new();
# For use in an individual filter module:
my $module = Courier::Filter::Module::My->new(
...
logger => $logger,
...
);
# For use as a global Courier::Filter logger object:
my $filter = Courier::Filter->new(
...
logger => $logger,
...
);
DESCRIPTION
This class is a syslog logger class for use with Courier::Filter and its filter modules. It is derived from
Courier::Filter::Logger::IOHandle.
Constructor
The following constructor is provided:
new: returns Courier::Filter::Logger::Syslog; throws Courier::Error
Creates a new logger that logs messages to syslog.
Instance methods
The following instance methods are provided, as inherited from Courier::Filter::Logger::IOHandle:
log_error($text): throws Perl exceptions
Logs the error message given as $text (a string which may contain newlines).
log_rejected_message($message, $reason): throws Perl exceptions
Logs the Courier::Message given as $message as having been rejected due to $reason (a string which may contain newlines).
SEE ALSO
Courier::Filter::Logger::IOHandle, Courier::Filter::Logger, Courier::Filter::Overview.
For AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview.
AUTHOR
Julian Mehnle <julian@mehnle.net>
perl v5.14.2 2011-12-27 Courier::Filter::Logger::Syslog(3pm)