... open a file and scan inside ...
to see if it contain a start tag and end tag which the end tag is the mirror image of the start tag and inside the file there is "http://"
...
And do what having seen it ?
I assume you want to print that line.
Here's a way to do it with Perl:
Code:
$
$ cat -n f9
1 <mytag>something here</mytag>
2 <start>jdahsjdaskjdsahttp://sanhdjashd<trats>
3 <show>Wicked</show>
4 A line here
5 <author>Gregory Maguire</author>
6 <venue>Broadwayhttp://www.broadway.com/shows/wicked<eunev>
7 and here...
8 <theme>Reimagining of The Wizard of Oz<emeht>
9 <verdict>amazinghttp://amazing<tcidrev>
$
$ perl -lne 'print if /^<(.*)>.*http:\/\/.*<(.*)>/ and $2 eq reverse $1' f9
<start>jdahsjdaskjdsahttp://sanhdjashd<trats>
<venue>Broadwayhttp://www.broadway.com/shows/wicked<eunev>
<verdict>amazinghttp://amazing<tcidrev>
$
$
I'm using the URL Regex feature of Squid for allowing sites via a list of regex strings to match allowed domains. The regex was actually copied from our previous proxy solution and it seemed to "just work". But, we've recently discovered that some domains (likely due to virtual hosts or host... (2 Replies)
I'm trying to compare the last octet of an IP to a regex:
IP=$(ifconfig eth0 | grep inet | awk -F: '{print $2}' | awk -F. '{print $4}' | awk '{print $1}')
if ]; then
echo "GOOD: Correct IP range for server"
else
echo "ERROR:... (6 Replies)
Let's say I'm trying to match potentially multiple sets of parentheses. Is there a way in a regular expression to force a match of closing parentheses specifically in the number of the opening parentheses?
For example, if the string is "((foo bar))", I want to be able to say "match any number of... (7 Replies)
Hi folks,
Lets say I have the following text file:
name, lastname, 1234, name.lastname@test.com
name1, lastname1, name2.lastname2@test.com, 2345
name, 3456, lastname, name3.lastname3@test.com
4567, name, lastname, name4.lastname4@test.com
I now need the following output:
1234... (5 Replies)
Hi,
I've a logfile which i need to parse and get the logs depending upon the user input. here, i'm providing an option to enter the string which can be matched with the log entries.
e.g. one of the logfile entry reads like this -
$str = " mpgw(BLUESOAPFramework):... (6 Replies)
I have a huge file that has roughly 30304 lines. I need to extract specific info from that file. For example,
Box 1 > *aaaaaaaajjjj*
> hbbvjvj
> jdnnfddllll
> *dgdfhfekwjh*
Box 2 > *aaaaaaa'aj'jjj*
> dse hkjuejef bfdw
> dyeee
> dsewq
> *dgdfhfekwjh*
>feweiuei
Box 3 > *aaaa"aaaaj"jjj*
>... (25 Replies)
Hi,
I'm trying to validate if a string matches a regular expression, but it is not working. Am I missing something? Do I need to scape any of the characters?
if echo 'en-GB' | egrep '({1,8})(-{1,8})*' >/dev/null; then
echo Valid value
fi
Thanks in advance (6 Replies)
There are 4 files inside one folder matching criteria i.e. File name = ABCJmdmfbsjopXXXXXXX_mm-dd-yyyy_XXX.data
Here is the Code which find the files matching criteria:-
TS=`date +"%m-%d-%Y"`| for fname in `find . -name "ABCJmdmfbsjop???????_${TS}*.data"`
do # Matching File Processing Code.... (1 Reply)
I am trying to find patterns in files using grep -l -e. I specifically am searching for abc. I want any file that has abc in it, but not just the letters abc. I am searching for a pattern a followed by b followed by c. I have tried egrep -l and also I have tried the following:
grep -el... (2 Replies)
Hi all,
I want to extract rows with the pattern ALPHANUMERIC/ALPHANUMNERIC in the 2nd column.
I dont wan rows with more than 1 slash or without any slash in 2nd column.
a a/b
b a/b/c
c a/b//c
d t/y
e r
f /f
I came up with the regex
grep '\/$' file
a a/b
b a/b/c
d t/y (3 Replies)
Discussion started by: jianp83
3 Replies
LEARN ABOUT DEBIAN
html::prototype::helper::tag
HTML::Prototype::Helper::Tag(3pm) User Contributed Perl Documentation HTML::Prototype::Helper::Tag(3pm)NAME
HTML::Prototype::Helper::Tag - Defines a tag object needed by HTML::Prototype
SYNOPSIS
use HTML::Prototype::Helper;
DESCRIPTION
Defines a tag object needed by HTML::Prototype
REMARKS
Until version 1.43, the internal function $self-_tag> used $tag-as_XML> as its return value. By now, it will use $tag-as_HTML( $entities )>
to invokee HTML::Entities::encode_entities. This behaviour can be overridden by setting $HTML::Prototype::Helper::Tag::USE_ASXML_FOR_TAG to
1.
METHODS
HTML::Prototype::Helper::Tag->new( $object_name, $method_name, $template_object, $local_binding, $object )
$tag->object_name( [$object_name] )
$tag->method_name( [$method_name] )
$tag->template_object( [$template_object] )
$tag->local_binding( [$local_binding] )
$tag->object( [$object] )
$tag->value( )
$tag->value_before_type_cast( )
$tag->to_input_field_tag( $field_type, \%options )
$tag->to_content_tag( $tag_name, $value, \%options )
SEE ALSO
HTML::Prototype, <http://prototype.conio.net/>
AUTHOR
Sascha Kiefer, "esskar@cpan.org"
Built around Prototype by Sam Stephenson. Much code is ported from Ruby on Rails javascript helpers.
LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
perl v5.10.1 2006-05-22 HTML::Prototype::Helper::Tag(3pm)