Harry Putnam wrote:
I may have turned the question around from the usual approach, but I'm
having trouble seeing why my script gives the right answer.
The script reads data that contains dates in the format YYMMDD N, the
N isn't part of the date but is also a digit.
What the script tries to do
I may have turned the question around from the usual approach, but I'm
having trouble seeing why my script gives the right answer.
The script reads data that contains dates in the format YYMMDD N, the
N isn't part of the date but is also a digit.
What the script tries to do is read the dates, run
I get following error when trying to open a session using
Apache::Session::MySQL.
Here is what I have
38 tie %session, " Apache::Session::MySQL", undef,{
39 Handle => $dbh,
40 LockHandle => $dbh
41 };
Could not create new session: Can't loca
On Sun, 18 Apr 2010 17:09:59 +0100
Mimi Cafe wrote:
> I am trying to test user input to ensure it contains special
> character or symbols that could cause problems to my program or
> database.
>
> The user will enter a keyword in the web form to search in my
> database, and I want to ensure I do
>$str =~ m{ \A ( .{0,15} .*? ) \s }msx;
Yeah, this would do. I talked about the scenario where you didn't put "{0,15}",
but just "{15}". In that case, it wouldn't work if the value given in the
match string (15 as per above eg.) is greater than the character count of the
particular string
Mimi Cafe wrote:
From: John W. Krahn [mailto:jwkr...@shaw.ca]
Mimi Cafe wrote:
I used MySQL substr function to extra 100 characters from the result of a
query, but understandably, I don't get what I want.
Now I looked at Perl's substr function and it doesn't look like it can
help me achieve
It is a bit tricky. Just tried it and Perl warned:
The string is: The black cat is.
Can't do {n,m} with n > m in regex; marked by <-- HERE in m/ \A ( .{19,18}
<-- HERE ?\s+ \b ) / at substr.pl line 10.
My strings are not fixed length, but I do they are normally longer that the
offset I used, so
I am trying to test user input to ensure it contains special character or
symbols that could cause problems to my program or database.
The user will enter a keyword in the web form to search in my database, and
I want to ensure I don't play around with special character otherwise any
word or phras
Mimi Cafe wrote:
I used MySQL substr function to extra 100 characters from the result of a
query, but understandably, I don't get what I want.
Now I looked at Perl's substr function and it doesn't look like it can help
me achieve what I need to.
Let's say I have:
$s = "The black cat climbed th
Akhthar Parvez K wrote:
Hi Shawn,
$str =~ m{ \A ( .{15} .*? ) \s }msx;
I don't think this would work if the value given in the match string (15 as per
above eg.) is greater than the character count of the particular string. Right?
No, it will fail if $str is less than 15 characters. Try:
Harry Putnam wrote:
"John W. Krahn" writes:
[...]
From:
http://www.rfc-editor.org/rfc/rfc5322.txt
2.2. Header Fields
[...]
(and even within some of the lexical tokens), folding SHOULD be
limited to placing the CRLF at higher-level syntactic breaks. For
CRLF is mentioned
Hi,
> It works fine and I like it. My regex is not that good, but I can see what
> is doing. I modified it a bit (to capture up till a full stop sign).
Kewl. Good to hear that!
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be
Hi,
It works fine and I like it. My regex is not that good, but I can see what
is doing. I modified it a bit (to capture up till a full stop sign).
#!/usr/bin/perl
#
use strict;
use warnings;
#
my $str = "The black cat is trying to climbed the green tree. This time it
failed."; print "string: $s
"John W. Krahn" writes:
[...]
> From:
>
> http://www.rfc-editor.org/rfc/rfc5322.txt
>
>
> 2.2. Header Fields
[...]
> (and even within some of the lexical tokens), folding SHOULD be
> limited to placing the CRLF at higher-level syntactic breaks. For
CRLF is mentioned in several
Hi Shawn,
> $str =~ m{ \A ( .{15} .*? ) \s }msx;
I don't think this would work if the value given in the match string (15 as per
above eg.) is greater than the character count of the particular string. Right?
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple ope
Mimi Cafe wrote:
$s = "The black cat climbed the green tree";
$substring = substr( $s, 1, 15); # this will return "The black cat c".
How can I have this return the whole word climbed rather than the c (i.e. I
need to get "The black cat climbed")? I need to get the remaining characters
from
Hi Mimi,
> How can I have this return the whole word climbed rather than the c (i.e. I
> need to get "The black cat climbed")? I need to get the remaining characters
> from the length till the next white space or end of a phrase.
> Any other way to overcome this limitation? How can I use regex he
I used MySQL substr function to extra 100 characters from the result of a
query, but understandably, I don't get what I want.
Now I looked at Perl's substr function and it doesn't look like it can help
me achieve what I need to.
Let's say I have:
$s = "The black cat climbed the green tr
18 matches
Mail list logo