Hi
Can somebody please help me know how do i match the basename using a regular expression using posix standard in shell script
suppose i want to match
/u01/Sybase/data/master.dbf the result should be master.dbf as i want to match everything after the last /
regards (8 Replies)
Hi
Input:
MYTEXT.aa.bb
cc.MYTEXT.aa.bb
ee.dd.cc.MYTEXT.aa.bb
cc.NOTEXT.a.b
Output:
<empty>
cc
cc
<empty>
I would like to use a regex to extract the last word before MYTEXT without the dot (2 Replies)
Hello to all,
I have:
X="string 1-"
Y="-string 2"
Z="string 1-20-string 2"In the position of the number 20 could be different numbers, but I'm interest only when the number is 15, 20,45 or 70.
I want to include an IF within an awk code with a regex in the following way.
... (12 Replies)
Hi
We have a tool to monitor logs in our environment. The tool accepts log pattern match only using regex and I accept I am a n00b in that:confused:. I had been banging my head to make it work without much success and at last had to turn on to my last option to post it here. I had got great... (2 Replies)
push @MACARRAY, "$+{catalog} $+{machine}\n" if ($info =~ /(?<catalog>catalog).+?(?<machine>\*+)/ms);
I am (still) trying to solve problem. Looking around on the server I found this piece of code. Specifically what does "$+{catalog} $+{machine}\n"
do ?
Thanks in advance (1 Reply)
I have a scripting problem that I'm trying to solve, whereby I want to match that a string contains either of three strings. I'm thinking this is probably just me not understanding how to craft the appropriate regex. However, here's what I would like to do:
] && do-something
more... (10 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)
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
LEARN ABOUT DEBIAN
graphviz::regex
GraphViz::Regex(3pm) User Contributed Perl Documentation GraphViz::Regex(3pm)NAME
GraphViz::Regex - Visualise a regular expression
SYNOPSIS
use GraphViz::Regex;
my $regex = '(([abcd0-9])|(foo))';
my $graph = GraphViz::Regex->new($regex);
print $graph->as_png;
DESCRIPTION
This module attempts to visualise a Perl regular expression. Understanding regular expressions is tricky at the best of times, and regexess
almost always evolve in ways unforseen at the start. This module aims to visualise a regex as a graph in order to make the structure clear
and aid in understanding the regex.
The graph visualises how the Perl regular expression engine attempts to match the regex. Simple text matches or character classes are
represented by.box-shaped nodes. Alternations are represented by a diamond-shaped node which points to the alternations. Repetitions are
represented by self-edges with a label of the repetition type (the nodes being repeated are pointed to be a full edge, a dotted edge points
to what to match after the repetition). Matched patterns (such as $1, $2, etc.) are represented by a 'START $1' .. 'END $1' node pair.
This uses the GraphViz module to draw the graph.
METHODS
new
This is the constructor. It takes one mandatory argument, which is a string of the regular expression to be visualised. A GraphViz object
is returned.
my $graph = GraphViz::Regex->new($regex);
as_*
The regex can be visualised in a number of different graphical formats. Methods include as_ps, as_hpgl, as_pcl, as_mif, as_pic, as_gd,
as_gd2, as_gif, as_jpeg, as_png, as_wbmp, as_ismap, as_imap, as_vrml, as_vtx, as_mp, as_fig, as_svg. See the GraphViz documentation for
more information. The two most common methods are:
# Print out a PNG-format file
print $g->as_png;
# Print out a PostScript-format file
print $g->as_ps;
BUGS
Note that this module relies on debugging information provided by Perl, and is known to fail on at least two versions of Perl: 5.005_03 and
5.7.1. Sorry about that - please use a more recent version of Perl if you want to use this module.
AUTHOR
Leon Brocard <acme@astray.com>
COPYRIGHT
Copyright (C) 2000-1, Leon Brocard
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
perl v5.14.2 2012-04-02 GraphViz::Regex(3pm)