Manually create array that matches mysql_fetch_array528 (11/29/2012 8:51:04 AM) comp.lang.php In my script, I'm potentially creating information to insert in to MySQL (based on a few variables), then later in the script I'm SELECTing the same data back out of MySQL. Like this:
if ($_GET['whatever']) ... Jason
Regex question, limit repeats UNLESS within specified tags521 (11/2/2012 12:31:57 AM) comp.lang.perl.misc I'm currently limiting repeated characters like so:
$text =~ s#(.)\1{6,}#$1$1$1$1$1$1#gsi;
I'm wanting to modify it to only limit repeated characters if they're not within or tags.
I'm guessing that ... Jason
Converting www to http://www (regex negative look-behind)435 (10/29/2012 3:01:30 AM) comp.lang.perl.misc I'm using URI::Find to create links when a user submits a website address. Meaning, this:
http://www.google.com
becomes:
http://www.google.com
Every once in awhile, someone will submit a link withou... Jason
str.replace() not catching, need a second set of eyes639 (10/3/2012 9:25:13 AM) comp.lang.javascript I'm working with a contenteditable field. When someone pastes data that inc=
ludes ... or ...,=
I want the tags to be removed.
Here is the exact code I'm using:
a =3D a.replace(/]*?itxt[^>]*?>([\s\S]*?... Jason
Multiple INSERT INTO... ON DUPLICATE in a single query739 (9/24/2012 2:43:33 AM) comp.databases.mysql I'm currently updating 3 columns with one query, like so:
UPDATE table SET col=col+1 WHERE id=%s OR id=%s OR id=%s
I'm changing the structure of the database, though, and now need to use something more li... Jason
PHP Update445 (9/17/2012 9:31:08 AM) comp.lang.php I'm currently using PHP v. 5.2.17. Would you guys recommend updating to 5.3.x for security, or are there any stability concerns with the newer releases? Am I going to run in to compliance problems with my PHP s... Jason
Setting backreference inside of a string1431 (9/10/2012 6:41:40 AM) comp.lang.perl.misc I'm doing a replace, like this:
$text = "Yes dear!";
$pattern = "(D|d)ear";
$replace = "$1eer";
$text =~ s/$pattern/$replace/gi;
That's just an example, of course; the real $pattern and $replace come... Jason
Dynamic backreferences, finding last in a group239 (9/9/2012 10:31:59 AM) comp.lang.php I'm working with preg_replace(), like so:
$pattern =3D array();
foreach ($filter as $org)
array_push($pattern, "/((|\s)*)$org(er|in|...)/i");
$text =3D preg_replace($pattern, '$1$new$3', $text);
... Jason
Sending nothing when function expects variable525 (8/28/2012 6:51:16 AM) comp.lang.php I have a function like:
function whatever($a, $b, $c) {
if (!$b) $b = "something";
if (!$c) $c = "something else";
// etc
}
Since I'm checking for $b and $c in the function, I call the functio... Jason
Simple (Rookie) Question533 (10/28/2012 9:33:16 PM) comp.lang.perl.misc A kind volunteer wrote an effective perl script for my website ten or
more years back.
The script was called from header.html, and worked flawlessly for
years...until someone decided to mess with the hea... cashdirect7(1)
Setting backreference inside of a string1431 (9/10/2012 6:41:40 AM) comp.lang.perl.misc I'm doing a replace, like this:
$text = "Yes dear!";
$pattern = "(D|d)ear";
$replace = "$1eer";
$text =~ s/$pattern/$replace/gi;
That's just an example, of course; the real $pattern and $replace come... jwcarlton(271)
Stupid regex problem, s/// catching extra letter355 (7/18/2012 4:01:58 AM) comp.lang.perl.misc I know better than to work late at night, but sometimes it just can't be helped :-)
I'm doing a simple s///, converting "www." to "http://www." when "www." occurs without a preceding "http://". Here's what I... jwcarlton(271)
Short words473 (7/16/2012 9:15:11 AM) comp.databases.mysql Do any of you have a way around the "short word feature", other than modify=
ing ft_min_word_len? I'm getting more and more complaints that my "search e=
ngine sucks" because it can't tell the difference betw... jwcarlton(271)