|
|
Browse by Tags
All Tags » perl
-
Hello, I need help on matching and replacing text with different matched text from same string. My goal is to be able to batch process a large set of text files that each have similar patterns and replacement criteria. Below is an example of a typical case. In the example below, BOLD text replaces strikeout text:
TITLE: Beautiful Losers - ...
-
#!/usr/bin/perl -w
$text = "Ace of Base - All That She Wants (1993)";
if($text =~ m/^([^-]+)\s*-\s*(.*)$/) {
print "$1\n";
print "$2\n";
}
-
I have a regex which works in Perl, but not in Mysql and I was wondering what might be causing the problem. Here it is: ([KR-]\.[^KR]*?[KR][\@|\#]([^KR]*?[KR][\@|\#])*\.)|([KR-]\.[^KR]*?[KR][\@|\#]([^KR]*?[KR][\@|\#])*[^KR]*?\.\-)|([KR-]\.([^KR]*?[KR][^\@|\#])*[^KR]*?[KR]+\.)|([KR-]\.([^KR]*?[KR][^\@|\#])*[^KR]*?\.\-)The error that it gives is ...
-
I'm trying to use Trend Micro's Security Dashboard to filter a lot of spam we've been getting that is in the following form:
From: various crap email addresses (different every time)
To: various internal email addresses
Subject: blank, or occasionally containing one word
Body: always blank
Attachment: A small pdf file of ...
-
I am doing parsing of html to pick up url's with url-titles from web-pages using PERL (actually I am using a Perl-script not made by me that takes url-adresses and regexps as input to produce links from the wanted site). I often get problems related to controlling matching patterns in single lines vs multiple lines. Sometimes I always ...
-
Now you've done it. You made me try my rusted Perl skills again.
I wrote a little script for testing the pattern:
#!/usr/bin/perl
use warnings;
use strict;
my $sender = shift || die "Need a sender email address!\n";
my $header = "From: Xxx Yyy <$sender>
Subject: Something
To: Aaa Bbb <aaa_bbb\@zzz.com>
... ...
-
Sergei is of course right. You can use the or operator (|) within the forward assertion. I don't think there's a performance difference, but it looks nicer this way.
About setting the modifiers:
You stated that Perl was "somehow" involved in the process, but I don't know how you pass the regular expression to the ...
-
Hi All, I'm new to this forum.
I use perl to do the regex, and AFAIK, regex do the parsing from left to right,
so if I use /A.*?D/ on A1BA2CA3DA4E, the matched result will be A1BA2CA3D
so what is the regex to match an example case A3D on A1BA2CA3DA4E,
Note : The numbers in between (1,2,3) is only an example for any character ...
|
|
|