Sponsored Content
Full Discussion: Regex for CAR- and CAR_
Top Forums UNIX for Dummies Questions & Answers Regex for CAR- and CAR_ Post 302933408 by Don Cragun on Thursday 29th of January 2015 07:04:13 PM
Old 01-29-2015
If you don't identify what is using the regular expression, the requirements will often vary. In this case:
CAR[-_]
will match either of these strings anywhere in a line or file or string in you need a basic regular expression or extended regular expression that can be used in many utilities; it will not work in a filename matching pattern unless the regular expression is intended to only match an entire filename.
This User Gave Thanks to Don Cragun For This Post:
 

4 More Discussions You Might Find Interesting

1. What is on Your Mind?

Man develops Car that runs using water as fuel

It's a metacafe video, doesn't work with tags. Here's the link Man Develops a Car Which Runs Solely on Water ! Video This is good news, I guess if water replaces oil we won't get a heart attack any more when we see fuel prices keep escalating because arabs and israeli's keep fighting. (1 Reply)
Discussion started by: sparcguy
1 Replies

2. Shell Programming and Scripting

Converting perl regex to sed regex

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)
Discussion started by: suntzu
1 Replies

3. Shell Programming and Scripting

Sendmail K command regex: adding exclusion/negative lookahead to regex -a@MATCH

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

4. Shell Programming and Scripting

sed or revelent command to remove car

How to remove the digits. I need to check after / if I have more the 3 digit remove all including backslash Input file portshow 8/150800 portshow 9/150900 portshow 12/150c00 portshow 12/150 portshow 15/150f00 portshow 16/151000 portshow 17/151100 portshow 17/15... (6 Replies)
Discussion started by: ranjancom2000
6 Replies
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)
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy