BASH - Regular Expressions :Looking for one word on multiple lines.
Im looking for a bash solution that will use Regular Expressions (not perl, sed or awk) to check the example data below and then give me a status.
which would be just simply Match or Mismatch.
Im not asking about how to create a script to do this for me. I am asking for a "better" "nicer" regex expression than the one given below. Its just ugly ... know ?
Thanks in advance
Pop
Last edited by Scrutinizer; 01-11-2016 at 05:09 PM..
Reason: Change quote tags to code tags
I'm trying to parse RichText to XML. I want to be able to capture everything between the '/par' tag in the RTF but not include the tag itself. So far all I have is this, '.*?\\par' but it leaves '\par' at the end of it. Any suggestions? (1 Reply)
Hi Gurus,
I need help with regular expressions. I want to create a regular expression which will take only alpha-numeric characters for 7 characters long and will throw out an error if longer than that.
i tried various combinations but couldn't get it, please help me how to get it guys.
... (2 Replies)
Hi,
below is a piece of code written by my predecessor at work.
I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code.
It is really a tough time for me to figure out all the regular expressions.
Please shed some light on the regular expressions... (3 Replies)
In regular expressions with grep(or egrep), ^ works if we want something in starting of line..but what if we write ^^^ or ^ for pattern matching??..Hope u all r familiar with regular expressions for pattern matching.. (1 Reply)
I am new to shell scripts.Can u please help me on this req.
test_user = "Arun"
if
echo "test_user is a word"
else
echo "test_user is not a word" (1 Reply)
Hi
Ilove unix and alwyas trying to to learn unix,but i am weak in using regular expressions.can you please give me a littel brief discription that how can i understand them and how to use .your response could lead a great hand in my unix love. (1 Reply)
Hi Team,
I have two strings like:
xxx|yyy|Arizona Cardinals| Tell Cardinals | Cardinals
bbb|Bell Earn, Jr | Bell Earn | Jayhawks | hawks
I have a lookup file which has a set of strings. These need to be removed from above two strings
Lookup file Contents:
Bell Earn, Jr
hawks... (2 Replies)
Using a regular expression, I would like multiple lines to be matched.
By default, a period (.) matches any character except newline. However, (?s) and /s modifiers are supposed to force . to accept a newline and to match any character including a newline.
However, the following two perl... (4 Replies)
Hi All.
Attached are two files.
I ran a query and have the output as in the file with name "FILEWITHFOURRECORDS.txt "
I didn't want all the spaces between the columns so I squeezed the spaces with the "tr" command and also added a carriage return at the end of every line.
But in two... (3 Replies)
Discussion started by: sparks
3 Replies
LEARN ABOUT MOJAVE
ppi::document::normalized
PPI::Document::Normalized(3) User Contributed Perl Documentation PPI::Document::Normalized(3)NAME
PPI::Document::Normalized - A normalized Perl Document
DESCRIPTION
A "Normalized Document" object is the result of the normalization process contained in the PPI::Normal class. See the documentation for
PPI::Normal for more information.
The object contains a version stamp and function list for the version of PPI::Normal used to create it, and a processed and delinked
PPI::Document object.
Typically, the Document object will have been mangled by the normalization process in a way that would make it fatal to try to actually DO
anything with it.
Put simply, never use the Document object after normalization. YOU HAVE BEEN WARNED!
The object is designed the way it is to provide a bias towards false negatives. A comparison between two ::Normalized object will only
return true if they were produced by the same version of PPI::Normal, with the same set of normalization functions (in the same order).
You may get false negatives if you are caching objects across an upgrade.
Please note that this is done for security purposes, as there are many cases in which low layer normalization is likely to be done as part
of a code security process, and false positives could be highly dangerous.
METHODS
new
The "new" method is intended for use only by the PPI::Normal class, and to get ::Normalized objects, you are highly recommended to use
either that module, or the "normalized" method of the PPI::Document object itself.
version
The "version" accessor returns the PPI::Normal version used to create the object.
functions
The "functions" accessor returns a reference to an array of the normalization functions (in order) that were called when creating the
object.
equal $Normalized
The "equal" method is the primary comparison method, taking another PPI::Document::Normalized object, and checking for equivalence to it.
The "==" operator is also overload to this method, so that you can do something like the following:
my $first = PPI::Document->load('first.pl');
my $second = PPI::Document->load('second.pl');
if ( $first->normalized == $second->normalized ) {
print "The two documents are equivalent";
}
Returns true if the normalized documents are equivalent, false if not, or "undef" if there is an error.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2005 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.18.2 2011-02-25 PPI::Document::Normalized(3)