Hi all,
I am trying to match a multi line string and return the matching string in one line. Here is the perl code that I wrote:
#!/usr/bin/perl
my $str='<title>My
title</title>';
if ($str =~ /(<title>)(+)(<\/title>)/ ){
print "$2\n";
}
It returns :
My
title
I want the... (3 Replies)
Dear all,
I have a simple issue on a perl regular expression. I want to get the characters in red from the next lines :
POWER_key
LEFT_key
RIGHT_key
OK_key
DOWN_key
and so on...
Thanks in advance for reply.
Ludo (1 Reply)
Hi,
I need and expression for a word like abc_xyz_ykklm
The expresion should indicate that the word starts with abc and end with ykklm but does not contain xyz string in the middle.
Example: abc_tmn_ykklm is ok and abc_xyz_ykklm is not Ok.
Please help.
Regards. (1 Reply)
Hi,
I am looking for a Perl regular expression to match the below pattern of a java script file.
var so = object.device.load('camera','value');
I want to grep out such lines present in the *.js files. The conditions are:
a) the line may start with blank space(s)
b) always the... (3 Replies)
Hello,
I am trying to use perl LWP module to read and get a specfic URL page. The issue is that the URL ends with the data and time and time is not consistent it changes all the time. if anyone could help me how to write a regular expressin that would work in the LWP::UserAgent get function to... (0 Replies)
Could you help me with this please. This regular expression seems to match for the wrong input
#!/usr/bin/perl
my $inputtext = "W1a$%XXX";
if($inputtext =~ m/+X+/)
{
print "matches\n";
}
The problem seems to be %. if inputtext is W1a$XXX, the regex doesnot match.... (5 Replies)
I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense.
... (4 Replies)
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Hi ,
I have the below array
my @actionText = ("delivered to governor on 21/23/3345" , "deliver jllj" , "ram 2345/43");
When i am trying to grep the contents of array and if mathced substituting with the digitis or some date format from the element like below
my @action = grep { $_ =~... (7 Replies)
Discussion started by: ragilla
7 Replies
LEARN ABOUT SUSE
ausearch_add_regex
AUSEARCH_ADD_REGEX(3) Linux Audit API AUSEARCH_ADD_REGEX(3)NAME
ausearch_add_regex - use regular expression search rule
SYNOPSIS
#include <auparse.h>
int ausearch_add_regex(auparse_state_t *au, const char *expr);
DESCRIPTION
ausearch_add_regex adds one search condition based on a regular expression to the current audit search expression. The search conditions
can then be used to scan logs, files, or buffers for something of interest. The regular expression follows the posix extended regular
expression conventions, and is matched against the full record (without interpreting field values).
If an existing search expression E is already defined, this function replaces it by (E && this_regexp).
RETURN VALUE
Returns -1 if an error occurs; otherwise, 0 for success.
SEE ALSO ausearch_add_expression(3), ausearch_add_item(3), ausearch_clear(3), ausearch_next_event(3), regcomp(3).
AUTHOR
Steve Grubb
Red Hat Sept 2007 AUSEARCH_ADD_REGEX(3)