Hi Frank,
On Wed, 25 Mar 2015 10:31:40 +0530
Frank Vino vinofra...@gmail.com wrote:
Hi Team,
How to understand Regular Expression in a easy way?
This page has links to some recommended tutorials about learning regular
expressions:
http://perl-begin.org/topics/regular-expressions/
Hi Frank,
when first learning regexps I read the section In the World of Regular
Expressions in the Lama-Book [1]. If you find this introduction to
slow, you might also take a look at chromatic's Modern Perl, which is
available for free [2].
Regards, Simon
Am
On Wed, 25 Mar 2015 10:31:40 +0530
Frank Vino vinofra...@gmail.com wrote:
Hi Team,
How to understand Regular Expression in a easy way?
Thanks,
Frank
Sorry Frank but there's no easy way. ☹
Some things to remember:
Some punctuation marks have special meaning, like periods, question
Thanks a lot Simon
-Frank
On Wed, Mar 25, 2015 at 5:44 PM, Simon Reinhardt si...@keinstein.org
wrote:
Hi Frank,
when first learning regexps I read the section In the World of Regular
Expressions in the Lama-Book [1]. If you find this introduction to
slow, you might also take a look at
Hi Team,
How to understand Regular Expression in a easy way?
Thanks,
Frank
Frank,
Just go through below site, it helps to build regex and test same easily.
http://www.regexr.com/
~Rahul
On Wed, Mar 25, 2015 at 10:42 AM, Akshay Mohit akshaymohit2...@gmail.com
wrote:
Just start using it and you will find it very easy to understand.
-Akshay
On Wed, Mar 25, 2015 at
Just start using it and you will find it very easy to understand.
-Akshay
On Wed, Mar 25, 2015 at 10:31 AM, Frank Vino vinofra...@gmail.com wrote:
Hi Team,
How to understand Regular Expression in a easy way?
Thanks,
Frank
Chaps,
Please i need help on the regular expression, i have the sample code below.
I only want to match the entries from the array to the file and print the
matching line
for example if i only want to match fc3/23, in my code it prints both the
lines fc3/2 and fc3/23. How to restrict to exact
Not sure I get it, but would
/^fc3\/2\b/
(assuming you're looking for fc3/2 and not fc3/23) work?
hth
paolino
On 23 Aug 2013, at 17:06, jet speed speedj...@googlemail.com wrote:
Chaps,
Please i need help on the regular expression, i have the sample code below.
I only want to match the
On Fri, 23 Aug 2013 17:06:41 +0100
jet speed speedj...@googlemail.com wrote:
my @check = (fc3/23, fc10/1, fc3/14, fc12/12);
my @check = qw( fc3/23 fc10/1 fc3/14 fc12/12 );
my $f2 = 'out.txt';
for my $element(@check) {
open my $fh2, '', $f2 or die could not open $f2: $!;
while (my $line =
On Fri, 23 Aug 2013 17:06:41 +0100
jet speed speedj...@googlemail.com wrote:
Chaps,
Please i need help on the regular expression, i have the sample code
below. I only want to match the entries from the array to the file
and print the matching line
for example if i only want to match
See sample code below
Chaps,
Please i need help on the regular expression, i have the sample code
below.
I only want to match the entries from the array to the file and print
the
matching line
for example if i only want to match fc3/23, in my code it prints both
the
lines fc3/2 and
On Aug 23, 2013, at 9:06 AM, jet speed wrote:
Chaps,
Please i need help on the regular expression, i have the sample code below.
I only want to match the entries from the array to the file and print the
matching line
for example if i only want to match fc3/23, in my code it prints both
Chaps,
I am testing all your code one by one, Appreciate your time and detailed
inputs.
Many Thanks
Sj
On Fri, Aug 23, 2013 at 6:01 PM, Jim Gibson jimsgib...@gmail.com wrote:
On Aug 23, 2013, at 9:06 AM, jet speed wrote:
Chaps,
Please i need help on the regular expression, i have
From: Dr.Ruud rvtol+use...@isolution.nl
On 2012-09-20 09:08, Octavian Rasnita wrote:
my ( $file_name ) = $data =~ /([^\\]+)$/g;
No need for that g-modifier.
--
Ruud
Yes, you are right. I added it by mistake.
Octavian
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For
i have string 'c:\p4\car\abc\xyz.csproj'
i just need to match the xyz.csproj
i tried few option but does not help.
can someone please suggest
regards
irfan
From: Irfan Sayed irfan_sayed2...@yahoo.com
i have string 'c:\p4\car\abc\xyz.csproj'
i just need to match the xyz.csproj
i tried few option but does not help.
can someone please suggest
regards
irfan
my $data = 'c:\p4\car\abc\xyz.csproj';
my ( $file_name ) = $data =~ /([^\\]+)$/g;
got it myself :)
thanks a lot
$line_to_add =~ m/([a-zA-Z]+\.csproj)/;
regards
From: Irfan Sayed irfan_sayed2...@yahoo.com
To: Perl Beginners beginners@perl.org
Sent: Thursday, September 20, 2012 12:07 PM
Subject: regular expression help
i have string 'c
On 09/20/2012 04:39 PM, Irfan Sayed wrote:
got it myself :)
thanks a lot
$line_to_add =~ m/([a-zA-Z]+\.csproj)/;
Hi Irfan,
Your solution will only match files that consist of ASCII alphabetic
characters followed by '.csproj'. It will also match these:
*
On Thu, 20 Sep 2012 17:13:07 +0930
Michael Brader mbra...@internode.com.au wrote:
A more idiomatic way to do this is to use the File::Spec module.
Inspect the output of this program for inspiration:
There's also File::Basename:
http://perldoc.perl.org/File/Basename.html
Regards,
thanks a lot for all the responses :)
regards
From: Shlomi Fish shlo...@shlomifish.org
To: Michael Brader mbra...@internode.com.au
Cc: beginners@perl.org
Sent: Thursday, September 20, 2012 2:53 PM
Subject: Re: regular expression help
On Thu, 20 Sep 2012
On 2012-09-20 09:08, Octavian Rasnita wrote:
my ( $file_name ) = $data =~ /([^\\]+)$/g;
No need for that g-modifier.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Hi All,
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find with regulare expression #if ($_=~
/\w{7}\s\w{4}\s\w{6}\s(\d{1,4})/i)
I ended up confused after reading your email.
Please specify INPUT + OUTPUT/condition.
You have already specify INPUT which is:
LOGICAL UNIT NUMBER 587
UID:60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11
LOGICAL UNIT NUMBER 128
UID:
On 11-05-11 11:38 AM, jet speed wrote:
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find with regulare expression #if ($_=~
On 11/05/2011 16:38, jet speed wrote:
Hi All,
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find with regulare expression
On May 11, 8:38 am, speedj...@googlemail.com (jet speed) wrote:
Hi All,
I need help in matching the regular expression, the file is as below.
I am trying to match number followed by Number ex 587, 128 in $1 and
60:06:01:60:42:40:21:00:3A:AA:55:37:91:8A:DF:11 in $2
the $1 match works find
Hi All,
Thanks for your time and valuable inputs, Appreciate it.
I will try your suggestions and test it in my program.
Sj
Hi,
Please could you advice, how can i write a regular expression for the
line below to capture 0079 and 69729260057253303030373
0079 Not Visible 69729260057253303030373
i tried this one, no luck
/(^\d{4})\s\w+\s\w+\s+\d+/ig)
Appreciate your help with this.
Sj
2011/4/27 jet speed speedj...@googlemail.com
Hi,
Please could you advice, how can i write a regular expression for the
line below to capture 0079 and 69729260057253303030373
0079 Not Visible 69729260057253303030373
i tried this one, no luck
2011/4/27 jet speed speedj...@googlemail.com:
Hi,
Please could you advice, how can i write a regular expression for the
line below to capture 0079 and 69729260057253303030373
0079 Not Visible 69729260057253303030373
This might help?
$ perl -le '
$str=0079 Not
On 27/04/2011 11:47, jet speed wrote:
Please could you advice, how can i write a regular expression for the
line below to capture 0079 and 69729260057253303030373
0079 Not Visible 69729260057253303030373
i tried this one, no luck
/(^\d{4})\s\w+\s\w+\s+\d+/ig)
Hi all,
Thanks for all our inputs,
The regular expression below works fine if do it for single line, i am
trying to caputre the match $1, and $2 into array. only the first line
is pushed to the array. what am i doing wrong ?
how to get all the $1 and $2 match values for each line into arrary ?
On 4/27/11 Wed Apr 27, 2011 8:32 AM, jet speed
speedj...@googlemail.com scribbled:
Hi all,
Thanks for all our inputs,
The regular expression below works fine if do it for single line, i am
trying to caputre the match $1, and $2 into array. only the first line
is pushed to the array.
On Wed, Apr 27, 2011 at 04:32:57PM +0100, jet speed wrote:
Hi all,
Thanks for all our inputs,
The regular expression below works fine if do it for single line, i am
trying to caputre the match $1, and $2 into array. only the first line
is pushed to the array. what am i doing wrong ?
how
On 11-04-27 12:47 PM, Jim Gibson wrote:
The metasymbol \d matches the characters [0-9], not the extended hexadecimal
set that includes A-Z. To match those, construct your own character class:
[0-9A-Z]
You can use the POSIX xdigit character class instead:
#!/usr/bin/env perl
use strict;
use
On Wed, Apr 27, 2011 at 2:48 PM, Shawn H Corey shawnhco...@ncf.ca wrote:
On 11-04-27 12:47 PM, Jim Gibson wrote:
The metasymbol \d matches the characters [0-9], not the extended
hexadecimal
set that includes A-Z. To match those, construct your own character class:
[0-9A-Z]
You can use
On 2011-04-27 18:47, Jim Gibson wrote:
The metasymbol \d matches the characters [0-9],
Beware: the \d matches 250+ code points. So don't use \d if you only
mean [0-9].
not the extended hexadecimal
set that includes A-Z. To match those, construct your own character class:
[0-9A-Z]
Or
Excellent Guys, I would like thank each one of you for inputs. Much
appreciated.
i got blinded by just the numbers 0079, i didn't cater for the next line
which is hex 007A, as one of you rightly pointed out [ 0-9A-Z] , does the
trick. its amazing to see different technique to achieve the same
. August 2009 08:23
An: beginners@perl.org
Betreff: Regular expression help
Dear list,
I am trying to import entries in a csv file into a relational database,
however there are entries such as:
a,b,c,d,e,f1,f2,g1,g2 which spoil my split(/,/).
The quotes group f1 and f2 as a single entry. I know each
Dear list,
I am trying to import entries in a csv file into a relational database,
however there are entries such as:
a,b,c,d,e,f1,f2,g1,g2 which spoil my split(/,/).
The quotes group f1 and f2 as a single entry. I know each each database
entry should be atomic, but I'll deal with that
DT == Dave Tang d.t...@imb.uq.edu.au writes:
DT a,b,c,d,e,f1,f2,g1,g2 which spoil my split(/,/).
DT Could someone provide some guidance?
use a CSV module. parsing csv files is a pain with regexes (even if
doable). there are very stable and fast csv modules on cpan so get one
and use it.
On Wed, Aug 26, 2009 at 02:23, Dave Tangd.t...@imb.uq.edu.au wrote:
Dear list,
I am trying to import entries in a csv file into a relational database,
however there are entries such as:
a,b,c,d,e,f1,f2,g1,g2 which spoil my split(/,/).
snip
Sounds like a job for [Text::CSV][1]. Of course,
On Wed, 26 Aug 2009 16:41:39 +1000, Chas. Owens chas.ow...@gmail.com
wrote:
On Wed, Aug 26, 2009 at 02:23, Dave Tangd.t...@imb.uq.edu.au wrote:
Dear list,
I am trying to import entries in a csv file into a relational database,
however there are entries such as:
a,b,c,d,e,f1,f2,g1,g2 which
On Wed, Aug 26, 2009 at 03:46, Dave Tangd.t...@imb.uq.edu.au wrote:
snip
for my $token ($line =~ /([,]|[^,]+)/g) {
I changed the single pipe (|) to double pipes (||) and $token also contained
empty strings. Could you explain the difference between the pipes?
snip
The pipe character in regexes
Hi All,
need help on regular expression.
i have string like this
ProductName = 8:EXFO RTU System 1.2.42
now i want regular expression in such a way that it will change the line to :
ProductName = 8:EXFO RTU System 1.2.43
i tried in the following way.
$_ =~
, 2009 4:10 PM
To: beginners@perl.org
Subject: regular expression help
Hi All,
need help on regular expression.
i have string like this
ProductName = 8:EXFO RTU System 1.2.42
now i want regular expression in such a way that it will change the line to :
ProductName = 8:EXFO RTU System 1.2.43
i
:41 PM
Subject: RE: regular expression help
Hi Irfan
This code solve your problem
my $p=\ProductName\ = \8:EXFO RTU System 1.2.42\;
my ($val)=$p=~ m/\d+.\d+.(\d+)\/;
my $inval=$val+1;
$p=~s/$val/$inval/;
print===$p\n;
thanks
Ajay
-Original Message-
From: Irfan Sayed [mailto:irfan_sayed2
For all
Thanks
Ajay
-Original Message-
From: Irfan Sayed [mailto:irfan_sayed2...@yahoo.com]
Sent: Wednesday, June 17, 2009 5:15 PM
To: beginners@perl.org
Subject: Re: regular expression help
it is not just 1.2.43 it may be anything
it may be like 2.3.56 or 2.0.12 and so on...
plz advice
Irfan Sayed wrote:
Hi All,
Hello,
need help on regular expression.
i have string like this
ProductName = 8:EXFO RTU System 1.2.42
now i want regular expression in such a way that it will change the line to :
ProductName = 8:EXFO RTU System 1.2.43
$ perl -le'
$_ = q[ProductName =
Ley, Chung wrote:
Hi,
I have a program that will take in a string that will resolve to a path
where the output is going to store.
The path can includes variables in this format %VariableName%.
The acceptable variableNames that the program will support are fixed to
a list such
Hi,
I have a program that will take in a string that will resolve to a path
where the output is going to store.
The path can includes variables in this format %VariableName%.
The acceptable variableNames that the program will support are fixed to
a list such as Person, Class, Dept. This
my $input =q(C:\Windows\%Person%\%Class%);
my @vars = $input =~ /%([^%]+)%/g;
local $, = $/;
print @vars;
On Tue, Apr 15, 2008 at 10:20 PM, Ley, Chung [EMAIL PROTECTED] wrote:
Hi,
I have a program that will take in a string that will resolve to a path
where the output is going to
Thank you!
This looks much cleaner.
From: Jialin Li [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 15, 2008 8:56 PM
To: Ley, Chung
Cc: beginners@perl.org
Subject: Re: Regular Expression Help
my $input =q(C:\Windows\%Person%\%Class%);
my @vars
Ley, Chung wrote:
Hi,
Hello,
I have a program that will take in a string that will resolve to a path
where the output is going to store.
The path can includes variables in this format %VariableName%.
The acceptable variableNames that the program will support are fixed to
a list such as
I have a string which have multiple placeholder, for example:
$str = 'Hello [[Name]], Your login id is [[Login]] !!!;
I want to replace all placeholder with some identifier. In above example:
identifier are Name and Login.
The regular expression for this requirment is pretty staightward:
Ashish Srivastava wrote:
I have a string which have multiple placeholder, for example:
$str = 'Hello [[Name]], Your login id is [[Login]] !!!;
I want to replace all placeholder with some identifier. In above example:
identifier are Name and Login.
The regular expression for this
Ashish ,
you might have the [ in a recurring sequence using [*
On 11/1/06, John W. Krahn [EMAIL PROTECTED] wrote:
Ashish Srivastava wrote:
I have a string which have multiple placeholder, for example:
$str = 'Hello [[Name]], Your login id is [[Login]] !!!;
I want to replace all
: Regular Expression Help
Ashish ,
you might have the [ in a recurring sequence using [*
On 11/1/06, John W. Krahn [EMAIL PROTECTED] wrote:
Ashish Srivastava wrote:
I have a string which have multiple placeholder, for example:
$str = 'Hello [[Name]], Your login id is [[Login]] !!!;
I want
Hi. I have some HTML files with lines like the following:
a name=w12234 /a h2A Title/h2
I'm using a regular expression to find these and capture the name
attribute (w12234 in the example) and the contents of the h2 tag (A
Title).
$_ =~ /a name=(w\d+)\s*\/a\s*h2(+)\/h2/
That's my regex,
Jonathan Weber wrote:
Hi. I have some HTML files with lines like the following:
a name=w12234 /a h2A Title/h2
I'm using a regular expression to find these and capture the name
attribute (w12234 in the example) and the contents of the h2 tag (A
Title).
$_ =~ /a
Jonathan Weber schreef:
a name=w12234 /a h2A Title/h2
I'm using a regular expression to find these and capture the name
attribute (w12234 in the example) and the contents of the h2 tag (A
Title).
$_ =~ /a name=(w\d+)\s*\/a\s*h2(+)\/h2/
That's my regex, except I'm having trouble with
On 24 Jul 2006, at 5:48 PM, Rob Dixon wrote:
- The character wildcard '.' is just a dot within a character
class, so [.\n]
will match only a dot or a newline
Ah, I hadn't realized that characters in [ ] are literals. That
clears up a lot of the problem.
- Regexes aren't the best way of
On 4/25/05, John W. Krahn [EMAIL PROTECTED] wrote:
Owen wrote:
I found a message from Randal Schwartz, Message-ID:
[EMAIL PROTECTED]#1/1
which gave a regular expression for a valid Unix name,
/^(?=.*?\D)[a-z\d]+$/
That works but why does it work?
/
^
I found a message from Randal Schwartz, Message-ID: [EMAIL PROTECTED]#1/1
which gave a regular expression for a valid Unix name,
/^(?=.*?\D)[a-z\d]+$/
That works but why does it work?
/
^ # Start of a string
(?=# 0 or 1 instance of
Owen mailto:[EMAIL PROTECTED] wrote:
: I found a message from Randal Schwartz, Message-ID:
: [EMAIL PROTECTED]#1/1
: which gave a regular expression for a valid Unix name,
:
: /^(?=.*?\D)[a-z\d]+$/
:
: That works but why does it work?
:
: /
: ^ # Start of a string
:(?=#
Owen wrote:
I found a message from Randal Schwartz, Message-ID:
[EMAIL PROTECTED]#1/1
which gave a regular expression for a valid Unix name,
/^(?=.*?\D)[a-z\d]+$/
That works but why does it work?
/
^ # Start of a string
(?= # 0 or 1 instance of
.*? # anything but a
Stone [S], on Thursday, March 10, 2005 at 16:46 (-0800) typed:
S That won't work either. When you say ([1-9]\d?) you're telling it
S (If there is a match) capture the stuff in parentheses and store it.
S When you say \1 you're telling the script you know that first
S batch of stuff you
I hope I don't have any bugs here :)
Just one. :)
Your expressions all say \d instead of \d? for the second digit in
each set, while the simple one correctly has \d?. So your
expressions had an unfair advantage and as a result finish faster.
Add \d? to your expressions, and you should find
Stone [S], on Friday, March 11, 2005 at 01:52 (-0800) made these
points:
S Just one. :)
S Your expressions all say \d instead of \d? for the second digit in
S each set, while the simple one correctly has \d?. So your
S expressions had an unfair advantage and as a result finish faster.
right,
I am quite new to programming and Perl, so please bear
with me.
I have a requirement to check the format of a field
before a record can be saved. The format of the field
needs to be double digit value separated by a .
(period) like 00.00.00. This I managed to do using
the following:
use strict;
CM Analyst wrote:
I am quite new to programming and Perl, so please bear
with me.
I have a requirement to check the format of a field
before a record can be saved. The format of the field
needs to be double digit value separated by a .
(period) like 00.00.00. This I managed to do using
Simplest is change the {2} to {1,2} for all your entries. Now you
mush have from 1 to 2 digits.
Wags ;)
I think what he really wants is to throw a fit when there is a leading zero
for which your solution won't cut it. Here is how I see it:
$field =~ /^[1-9]\d?\.[1-9]\d?\.[1-9]\d?$/
--
Peter Rabbitson wrote:
Simplest is change the {2} to {1,2} for all your entries. Now you
mush have from 1 to 2 digits. Wags ;)
I think what he really wants is to throw a fit when there is a
leading zero for which your solution won't cut it. Here is how I see
it:
$field =~
Peter Rabbitson [PR], on Thursday, March 10, 2005 at 14:00 (-0500)
wrote:
PR I think what he really wants is to throw a fit when there is a leading zero
PR for which your solution won't cut it. Here is how I see it:
PR $field =~ /^[1-9]\d?\.[1-9]\d?\.[1-9]\d?$/
yes, and for complexity:
$field
yes, and for complexity:
$field =~ /^([1-9]\d?)\.{2}\1$/;
I know you said that's untested, but I don't think it's correct.
You're saying:
1. ^ - Start
2. ([1-9]\d?) -Any character 1-9 followed by zero or one digit characters.
3. \.{2} - Two periods.
4. \1 - The same sequence of
Stone [S], on Thursday, March 10, 2005 at 12:51 (-0800) wrote the
following:
yes, and for complexity:
$field =~ /^([1-9]\d?)\.{2}\1$/;
S I know you said that's untested, but I don't think it's correct.
yes, I'm sorry for that, should be this correct:
$field =~ /^(?:([1-9]\d?)\.){2}\1$/;
$field =~ /^(?:([1-9]\d?)\.){2}\1$/;
That won't work either. When you say ([1-9]\d?) you're telling it
(If there is a match) capture the stuff in parentheses and store it.
When you say \1 you're telling the script you know that first
batch of stuff you captured? Well I want that here. But
This program
#!/usr/bin/perl -w
use strict;
while (DATA) {
chomp;
my $line = $_;
my @y =split (/\b[\w]+:/,$line);
#print scalar(@y);
print $line;
print \n\$y[0] $y[0]\n\$y[1] $y[1]\n\$y[2] $y[2]\n\$y[3] $y[3]\n\$y[4] $y[4]\n\$y[5]
$y[5]\n;
}
__DATA__
M:356 358 386 R:#132 W1:319 NRT:32
snip
__DATA__
M:356 358 386 R:#132 W1:319 NRT:32 R:#132
snip
but I would really like it to capture the first part of the element so
that the result would be;
M:356 358 386 R:#132 W1:319 NRT:32 R:#132
$y[0]
$y[1] M 356 358 386
$y[2] R #132
$y[3] W1 319
$y[4] NRT 32
$y[5] R #132
I'd
Bee wrote:
I'd do a little add on for the string, so it much easier for split.
# usuw;
my $line = M:356 358 386 R:#132 W1:319 NRT:32 R:#132;
print $line . \n;
$line =~ s/(\s)(\w{1,}:)/\x00$2/g; # So I add extra delimiters here.
print $line . \n;
my @d = split /\x00/, $line;
print $_ for @d;
But
Hi All,
I have 2 variables $last_accessed and $owner_line
$last_accessed=: Last accessed 20-Apr-04.12:57:30 by [EMAIL PROTECTED];
$owner_line=Owner: opc_bld : rwx (all);
-From $last_accessed i want the foll output in variables :
$view_day=20
$view_month=Apr
$view_year=04
-From
2003 17:34
À: [EMAIL PROTECTED]
Objet: Re: Regular expression help
Eurospace Szarindar [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
Thanks you, it works fine. Could you explain me why have you added the \1 ?
Hi,
A quick breakdown...
/(['])(((''|)|[^'])*?)\1(\s|$)/g
^^
1
Hi,
I tried to write a script to extrat data from the given DATA but I can find
the right regular expression to do that.
RULE: I need to catch everything between quotes (single or double) and if
inside exists a repeated quote (single or double) it is not seen as end of
the match.
Eurospace Szarindar [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
Hi,
I tried to write a script to extrat data from the given DATA but I can
find
the right regular expression to do that.
Hi Szarindar,
Firstly why are you using this format and trying to parse it yourself? If
Thanks you, it works fine. Could you explain me why have you added the \1 ?
I will have a look at Text::CSV
Michel
-Message d'origine-
De: Rob Anderson [mailto:[EMAIL PROTECTED]
Date: lundi 18 août 2003 16:39
À: [EMAIL PROTECTED]
Objet: Re: Regular expression help
Eurospace Szarindar
Eurospace Szarindar [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
Thanks you, it works fine. Could you explain me why have you added the \1 ?
Hi,
A quick breakdown...
/(['])(((''|)|[^'])*?)\1(\s|$)/g
^^
1
2
^^
Hi all.
I am hoping that someone can help me determine what is wronf with my regualr
expression.
background info: @array contains 'text', numbers, INT, or TINYINT.
I am trying to identify if the array element is a number.
What I have right now is:
if($array[$x] =~ /\d{1,3}?/)
{
do
if($array[$x] =~ /\d{1,3}?/)
{
...do something
}
Unfortunately this if statement never appears to come true.
That's because you have two quantifiers specified, the {1,3} and the ?.
for (@array) {
if ( m/^\d+$/ ) { #regex breaks on decimal numbers
do something...
}
}
--
To unsubscribe,
see my comments at bottom...
-Original Message-
From: Shaun Bramley [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: Regular Expression help
Hi all.
I am hoping that someone can help me determine what is wronf with my regualr
David --- Senior Programmer Analyst --- Wgo Wagner wrote:
Your log shows a space between the time and hyphen and hyphen and
Micro. You dont' have that in the regex and even more so, there is no
hyphen before Adapter log.
You might want:
I have the following line in a log file:
09-07-2002 11:39:25.95 - Microsoft Dial Up Adapter log opened.
The date and time will always change but the after that it's always
consistent (well opened will sometimes be closed) I need to get the entire
date in a variable and the entire time in a
Anchor with the ^ and you will have date in $1, time in $2 and
opened or closed in $3.
A shot.
Wags ;)
-Original Message-
From: Steve [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 08:12
To: [EMAIL PROTECTED]
Subject: regular expression help
I have
Message-
From: Sunish Kapoor
To: Nigel Peck
Cc: [EMAIL PROTECTED]
Sent: 7/3/02 6:51 PM
Subject: Re: Regular Expression Help sought
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the
first
record
even though I make
the file begin with a blank line
Peck
Cc: [EMAIL PROTECTED]
Sent: 7/3/02 6:51 PM
Subject: Re: Regular Expression Help sought
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the
first
record
even though I make
the file begin with a blank line by simply hitting enter !
Regards
Hi All,
I am new to Perl and need help to solve this one !
I have a txt file and the contents of the file are as below :
---CONTENTS OF TEXT FILE--
Abdullah Ahmed Hassan
Trading
Location Ruwi Souk St, Ruwi
Bus Hrs 0930-1300:1630-2200
P.O. Box 197
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the first record
even though I make
the file begin with a blank line by simply hitting enter !
Regards
Sunish
Nigel Peck wrote:
My first attempt, which may be a bit simplified, would be to substitute
any newline, which
I think you'll need 2 blank lines.
-Original Message-
From: Sunish Kapoor
To: Nigel Peck
Cc: [EMAIL PROTECTED]
Sent: 7/3/02 6:51 PM
Subject: Re: Regular Expression Help sought
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the first
record
even though I make
PROTECTED]
Sent: 7/3/02 6:51 PM
Subject: Re: Regular Expression Help sought
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the first
record
even though I make
the file begin with a blank line by simply hitting enter !
Regards
Sunish
Nigel Peck wrote:
My
: Re: Regular Expression Help sought
Dear Nigel,
Thanks a ton for the script..It works fine though it skips the first
record
even though I make
the file begin with a blank line by simply hitting enter !
Regards
Sunish
Nigel Peck wrote:
My first attempt, which may be a bit
1 - 100 of 115 matches
Mail list logo