eregi(php$, $stringtobecompared);
See: http://www.php.net/manual/en/ref.regex.php
Gurhan
- Original Message -
From: David Busby [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Tuesday, July 02, 2002 4:49 PM
Subject: [PHP] RegEx question
List,
How can I regex to compare
Im expecting a string like foo.png.
Im trying to replace 'foo' with another value that I have.
Im trying this -
$file = preg_replace('/([a-z][0-9]-_*)(.[a-z]{3,4})/i', $new_file .
$2, $_FILES['upload']['name']);
The second regex group works ok, its the first one I cannot figure out.
It is
Well Ive gotten
(.*)
and
([a-z]*[0-9]*_*-*)
to work thus far as the first group.
I would like to avoid option 1, and option 2 doesn't seem right
Gerard Samuel wrote:
Im expecting a string like foo.png.
Im trying to replace 'foo' with another value that I have.
Im trying this -
$file
$file = preg_replace('/^([a-z0-9\-\_]*).([a-z]{3,4})$/i', $new_file .
.$2, $_FILES['upload']['name']);
Maybe this?
Jim Lucas
- Original Message -
From: Gerard Samuel [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Tuesday, June 11, 2002 3:11 PM
Subject: [PHP] regex
Im expecting
This is baffling me, I have a form on one page that opens a php file in a
text area for editing. In order to view the contents of the file in the
text area I had to setup a eregi_replace(,a) string. When I save the
changes back to the text file I setup a reverse string i.e. [
eregi_replace(a,)
On Mon, Jun 03, 2002 at 11:15:15AM -0600, Jas wrote:
In order to view the contents of the file in the
text area I had to setup a eregi_replace(,a) string.
's are not legal in HTML. You need to escape them. When pulling stuff
out of the file, use htmlspecialchars() before displaying the
:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 10:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Regex Assistance
Hey All,
I am just begining to learn regex functions in PHP. Anyhow I
am trying
to code a preg_replace function which basically cleans a URL.
What I mean is say a url
Hey All,
I am just begining to learn regex functions in PHP. Anyhow I am trying
to code a preg_replace function which basically cleans a URL.
What I mean is say a url is index.php?page=hellolist=10start=4 you
pass that URL and say 'list' to the function (shown below) Anyhow I
want that to
this is what I use to get rid of line from the url
$qs = ereg_replace($, , ereg_replace(line=[^]*?, ,
$QUERY_STRING));
HTH
MArtin
-Original Message-
From: Scott Reismanis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 12:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Regex
This is not really specific to PHP (although the information might be useful
for all that form validation we all do), and for that I apologize in advance
(does anyone know of a regex mailing list?), but maybe someone here can help
with the following:
I find no good regex for checking valid
I use this, but it's a preg rather than ereg pattern:
'/([a-z0-9]+[a-z0-9\-]*\.)+[a-z0-9]+[a-z0-9\-]*[a-z0-9]+$/i'
Two problems (which in practice are so slight that I've foregone my usual
standards-analness to ignore them)
1) It will allow a domain name component (except the final one)
Hello!
I have got a big problem:
I have html content in $html variable, which contains href, src and
background tags. Those tags may contain relative adressess and absolute
addressess which begin with http(s): or cid: (mail inline attachements) and
mailto:
I have also variable
Show some code...
Thanks,
Ray BigDog Hunter
-Original Message-
From: kras [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 19, 2002 9:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto
Hello!
I have got a big problem:
I have html
BigDog Hunter
-Original Message-
From: kras [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 19, 2002 9:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto
Hello!
I have got a big problem:
I have html content in $html variable, which
Im trying to get a final output to be 'item' but Im unable to get
working. Could someone point me where Im going wrong.
Thanks
?php
$a = 'item rdf:about=http://www.trini0.org;';
$b = preg_replace(/(item)(\s.*)()/i, $1 . $3, $a );
echo $b;
?
--
PHP General Mailing List
I figured it out. Change the last line to
echo htmlspecialchars($b);
and you'll get the proper output.
Gerard Samuel wrote:
Im trying to get a final output to be 'item' but Im unable to get
working. Could someone point me where Im going wrong.
Thanks
?php
$a = 'item
When i try to use preg_match on strings that have ? inside them it
seems to not work.
Any ideas how to bypass this?
thanks
berber
Boaz Yahav a écrit :
When i try to use preg_match on strings that have ? inside them it
seems to not work.
Any ideas how to bypass this?
thanks
berber
--
Marius Ursache (3563 || 3494)
\|/ \|/
'/ ,. \`
use \? instead of ?
Boaz Yahav a écrit :
When i try to use preg_match on strings that have ? inside them it
seems to not work.
Any ideas how to bypass this?
thanks
berber
--
Marius Ursache (3563 || 3494)
\|/ \|/
'/ ,. \`
I'm trying to come up with a regular expression that will match the TL
and Second Level domain names in someone's email address ONLY.
So, say someone's address is [EMAIL PROTECTED], I
need to match ONLY pacbell.net. It shouldn't matter what the address
looks like, I'm looking for any number
([[-a-zA-Z0-0_]*)\.([a-zA-Z]{2,4}$
should fit ur needs :P
-Ursprungliche Nachricht-
Von: James Taylor [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 22. April 2002 10:17 PM
An: [EMAIL PROTECTED]
Betreff: [PHP] Regex
I'm trying to come up with a regular expression that will match the TL
-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 2:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Regex
I'm trying to come up with a regular expression that will
match the TL
and Second Level domain names in someone's email address ONLY
On Mon, 22 Apr 2002, James Taylor wrote:
I'm trying to come up with a regular expression that will match the TL
and Second Level domain names in someone's email address ONLY.
Whatever you're planning on doing with that, I hope you're ready for
addresses that end with .ac.uk and so on; trying
On Mon, 22 Apr 2002, Red Wingate wrote:
([[-a-zA-Z0-0_]*)\.([a-zA-Z]{2,4}$
Underscores are not permitted in domain names...
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a guest book , and I want to make sure that those people who sign the
guest book can't impersonate a member of the web site. the code below
checks the input string, which is the guestbook signer's name, against a
list of defined web site members. Is there any way to circumvent the code
I have a site where users can type whatever they want in and it posts it to a
database. I'm trying to eliminate whatever types of abuse I can think of,
and, since I'm using nl2br on the posts, I'm afraid a user might just hold
down enter for a couple of seconds and scroll everything off the
-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 12:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Regex Form Filter Help
I have a site where users can type whatever they want in and it posts it
to a
database. I'm trying to eliminate whatever types of abuse I can think
But hey, who doesn't have em eh? Anyway, here's my predicament. I want to
look for either the string http://; or for 1 or more spaces in a string.
Here's the regex I've got
preg_match(/http:\/\/ | [[:space:]]/i,$valToEval);
I can get each test case working individually, but as soon as I
?
-Original Message-
From: Carl E Shmidt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 11:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex expession problems
But hey, who doesn't have em eh? Anyway, here's my predicament. I want to
look for either the string http://; or for 1
Now I'm looking to find 1 or more digits in an input:
preg_match([[:digit:]],$valToEval);
I'm passing the value 12 and this thing still returns 0. What's going on?
Carl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
preg syntax is different to ereg (which you are using). You also need to
provide an output variable.
This would work:
preg_match( /[0-9]+/, $input, $output );
--
Matt
Carl E Shmidt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Now I'm looking to find 1 or
you tomorrow.
-Original Message-
From: Paul A. Procacci [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 28, 2002 4:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex
Hey all,
I'm been programming in php for a while, but I'm stumpt with this
one. You know the funny thing? It's
Hey all,
I'm been programming in php for a while, but I'm stumpt with this
one You know the funny thing? It's probably really simple Anyway
here it is Assume I have this query string:
ticket_id=3change_name=statuschange_value=3ticket_id=32=1=
And all I want is 2=1= Well, the closest I
Bas Jobsen wrote:
Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal:
Looking for a regex (preg or ereg) to remove
all 1, 2 and 3 character words.
?
$string=over deze regex loop ik nu al de hele dag en een uur te piekeren. 't
wil niet! of wel! l'a.;
$string= .$string;
while
Looking for a regex (preg or ereg) to remove
all 1, 2 and 3 character words.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$string = ereg_replace([A-Za-z']{1,3}, , $string); // don't forget I'm
I haven't checked but something like this.
-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 9:59
To: [EMAIL PROTECTED]
Subject: [PHP] Regex function needed
Looking
... the reason why it's performed in a while
loop is because of two or more short words following each other and thus
sharing a space...
Greets,
Edward
- Original Message -
From: Michael Kimsal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 07, 2002 11:58 PM
Subject: [PHP
;
- Original Message -
From: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Michael Kimsal [EMAIL PROTECTED]
Sent: Friday, February 08, 2002 12:33 AM
Subject: Re: [PHP] Regex function needed
I don't know if this is the best way but:
$str = This is or was a test
]; Michael Kimsal
Subject: Re: [PHP] Regex function needed
this might even work beter, to take comma's and periods etecetera into
account to:
$str = This is or was a test for short words, although an, should be
deleted to.;
while (ereg( [a-z]{1,3} , $str)) {
$str = eregi_replace( [a-z']{1,3
Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal:
Looking for a regex (preg or ereg) to remove
all 1, 2 and 3 character words.
?
$string=over deze regex loop ik nu al de hele dag en een uur te piekeren. 't
wil niet! of wel! l'a.;
$string= .$string;
while
]; [EMAIL PROTECTED]
Sent: Friday, February 08, 2002 1:10 AM
Subject: Re: [PHP] Regex function needed
Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal:
Looking for a regex (preg or ereg) to remove
all 1, 2 and 3 character words.
?
$string=over deze regex loop ik nu al de hele dag
);
$str = eregi_replace('([^a-z\' ])[a-z\']{1,3}$', '\1', $str);
echo $str;
-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 11:09
To: Michael Kimsal; [EMAIL PROTECTED]
Subject: Re: [PHP] Regex function needed
after some
Kimsal;
[EMAIL PROTECTED]
Subject: RE: [PHP] Regex function needed
I don't know about preg but how about this monster?
$str = I'm okay now aren't I. Do I work? 'mm;
while(eregi(' [a-z\']{1,3} ', $str))
$str = eregi_replace(' [a-z\']{1,3} ', ' ', $str);
while(eregi(' [a-z\']{1,3}([^a-z
Hi I like to ask something
say i got this line
b = bla.net
a = blabla.com
(a and b NOT a variable)
i want to use php to take the second line and want to grep the
blabla.com
how can i do that
Yamin Prabudy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
use
$rgTemp = split('[|]',$szTag);
instead of
$rgTemp = split(|,$szTag);
on line 2
PHP List wrote:
Hi,
Can someone please tell me why the this is happening:
1) $szTag = test|3;
2) $rgTemp = split(|,$szTag);
3) $szTag = $rgTemp[0];
4) $nItemID = $rgTemp[1];
^line numbers for
Hi,
Can someone please tell me why the this is happening:
1) $szTag = test|3;
2) $rgTemp = split(|,$szTag);
3) $szTag = $rgTemp[0];
4) $nItemID = $rgTemp[1];
^line numbers for ref only, not in actual code.
Will give me the error:
PHP Warning: unexpected regex error(14) in /test.php on
split() takes a regular expression,
this means you have to escape the | char with a \
like this:
$rgTemp = split(\|,$szTag);
bvr.
On Fri, 18 Jan 2002 14:40:25 -0800, PHP List wrote:
Hi,
Can someone please tell me why the this is happening:
1) $szTag = test|3;
2) $rgTemp =
Hi all,
I've got a regex that's working fine, apart from one little problem.
$tags = array (script,
!--!\[CDATA\[,
\]\]--);
foreach ($tags as $currentTag)
if (preg_match (/^\/. $currentTag. /, $content))
// do something
(checking to see if anything in the
Hi all,
I've got a regex that's working fine, apart from one little problem.
$tags = array (script,
!--!\[CDATA\[,
\]\]--);
A quick shot (perhaps I miss the point ;): if you do
$x = \[;
then $x will contain [. If you then do a regex with preg_match(/$x/,
...
If you want the [ to be escaped in the regex you have to double-escape
it:
$x = \ \[; (sorry, the two \ should be together without a space but my
stupid mail-app converts the string thinking it's an network address)
so $x will contain \[ as you want ( the first backslash escapes the
second).
If you want the [ to be escaped in the regex you have to double-escape
it:
$x = \ \[; (sorry, the two \ should be together without a space but my
stupid mail-app converts the string thinking it's an network address)
so $x will contain \[ as you want ( the first backslash escapes the
As far as I can see (notice: I'm not a regex-king ;) the regex seems
correct
to me. The only thing I'm wondering about is the /^ (second last line
of
the citation). Together with your expression in the array it results in
preg_match(/\/!\[CDATA\[/, ...)
I'm wondering if that (/![CDATA...) is
[EMAIL PROTECTED]
Sent: Monday, December 10, 2001 4:21 PM
Subject: [PHP] RegEx gurus help...
I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
img src='../_imgs
I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'
a URL,
a href=/dealers/index.asp
a link to an external JS
trying to write a regex for all of that
-Original Message-
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 9:22 AM
To: PHP Lists
Subject: [PHP] RegEx gurus help...
I need to replace all relative links in an html
doc with absolute links on the fly
Hey thanks! That was a good starting point...
-Brian
-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 10, 2001 9:35 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] RegEx gurus help...
The code below does almost
I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'
img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'
a URL,
a href=/dealers/index.asp
a link to an external JS
Hi there,
I am camping with a little regular expressions problem...
Problem: I want to check if $variable begins with a * (star), and it doesn't matter if
it starts with plenty of spaces...
My solution:
ereg(^[:space:]*\*,$variable)
But, it doesn't seem to work with the space part... The
My solution:
ereg(^[:space:]*\*,$variable)
Try
ereg(^[:space:]\**$,$variable)
or
ereg(^[ ]*\**$,$variable)
or
ereg(^[[:space:]]*\**$,$variable)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To
Hi
How does one extract a URL from HTML like :
a href=/abc/def/0,1234,567.html?xxx=abcde class=MyClass
I have an HTML file with many lines like this and I want to extract the
/abc/def/0,1234,567.html?xxx=abcde part from each one.
Assuming I can get the lines into an array, how can I extract
preg_match('/a href=(.*?)/i',$str,$reg);
Your URL will now be in $reg[1]
-Rasmus
On Sat, 15 Sep 2001, Boaz Yahav wrote:
Hi
How does one extract a URL from HTML like :
a href=/abc/def/0,1234,567.html?xxx=abcde class=MyClass
I have an HTML file with many lines like this and I want to
Hello all
In the Apache config file, we have the following directive:
SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1
FilesMatch .(gif|jpg)
Order Allow,Deny
Allow from env=local_ref
/FilesMatch
We use this to prevent people from directly linking to .gif and .jpg files.
This
I'm trying to find if a string exists inside a string. Instead of using
strstr() twice I want to use eregi() once.
What I want to check is if HTTP/1.1 302 or HTTP/1.0 302 exists in
some $output.
I'm trying something like :
eregi([\HTTP/1.\]+[0-1]+[\ 302\],$output)
eregi([HTTP/1.]+[0-1]+[
In case anyone is interested, eregi(HTTP/1.[01].302,$output) seems to
work :)
berber
-Original Message-
From: Boaz Yahav
Sent: Tuesday, July 31, 2001 2:03 PM
To: PHP General (E-mail)
Subject: [PHP] Regex question
I'm trying to find if a string exists inside a string. Instead of using
Am partially successfull after taking a further look into things. the following
(while ugnly) correctly catches everything except the \ character for some
reason. ideas?
if(preg_match(/['.' ,!@#$%\^*()+=\/\\:;?|]/',$MyString)){
# echo error, character found
}
-Original
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Dave) wrote:
Am partially successfull after taking a further look into things. the
following
(while ugnly) correctly catches everything except the \ character for some
reason. ideas?
if(preg_match(/['.'
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 12:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex help
hi all,
a little OT here, but need some quick help. I have a bunch of e-mails to
convert into sql entries and I'm stuck here.
I have:
, John Doe, [EMAIL PROTECTED], ..
I'm trying to parse an existing html file using php.
I need to use regex to find the first (and only the first) occurance of i
and the last (and only the last) occurance of /i in a string.
They will be replaced with ||.
example of a string:
blah blah isome stuff/i that i ineed to get/i blah
hi all,
a little OT here, but need some quick help. I have a bunch of e-mails to
convert into sql entries and I'm stuck here.
I have:
, John Doe, [EMAIL PROTECTED], ..
I just need to know what's the regex to switch around the name and e-mail
address.
TIA,
@lvin
--
PHP General
What exactly are you trying to do? Switch around in what way?
Jack
-Original Message-
From: Alvin Tan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 17, 2001 12:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regex help
hi all,
a little OT here, but need some quick help. I have a bunch
I am trying to write a script that needs a list of all the images in an HTML file.
I am trying this code
if (eregi ((img.+src=)(.+)[\s],$buffer, $regs ))
{
echo $regs[2]BRBR;
}
The problem, however is that when it looks at
IMG SRC=images/Logo.gif ALT=Only Child Club - The
into
the ().
- e r i c k
-Original Message-
From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 9:04 AM
To: [EMAIL PROTECTED]
Subject:[PHP] Regex Help
I am trying to write a script that needs a list of all the images in an HTML
file.
I am trying
ok, I'm having some continual regex
issues and perhaps someone can help
me out with this. I've got a series
of line of html that I am changing
to xhtml and in doing so, each of those
lines need to be appended with a /
before the closeting bracket.
the only pattern that they share is
that the
On Tuesday 10 July 2001 23:04, Jerry Lake wrote:
the only pattern that they share is
that the end of the line ends with a number,
quotes and a closing bracket i.e. 7
I can match that pattern, with .\d but
when I try to replace it, I also replace
the number at the end, and not just append
Forwarded to the list for suggestions...my regex is pretty rusty...
--
I've got a string full of HTML, and I'd like to highlight specific words in
the text by surrounding it with span class=highlight/span tags. That's
pretty simple:
$strIn =
Previously, Gyozo Papp said:
metacharacter.
Is a '.' inside of a [] a literal '.', or a 'any character'
A period inside a character class (i.e. inside a [] block) is just a
period, and not a metacharacter.
-dan
--
Don't let it end like this. Tell them I said something.
Is a '.' inside of a [] a literal '.', or a 'any character'
metacharacter?
--
-
Look lovingly upon the present,
for it holds the only things that are forever true.
-
metacharacter.
- Original Message -
From: Dennis Gearon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 2001. május 22. 09:34
Subject: [PHP] regex
Is a '.' inside of a [] a literal '.', or a 'any character'
?
--
-
Look
if (preg_match_all(|testing(.*?);blah|s, $str, $matches))
{
// do what you want with $matches: see in the manual!
var_dump($matches);
}
- Original Message -
From: George E. Papadakis [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: 2001. május 20. 19:18
Subject: [PHP] RegEx
Hi,
I have an ereg question::.
$data = a big string ,
while (ereg (testing([^;]*);blah(.*),$data,$args)) {
$this = $args[1];
$data = $args[2];
}
What I wanna do ,obviously, is to get all the strings between 'testng' and
'blah' in an array.
This will do it, yet when it wont work when
On Sunday 20 May 2001 19:18, George E. Papadakis wrote:
I have an ereg question::.
$data = a big string ,
while (ereg (testing([^;]*);blah(.*),$data,$args)) {
$this = $args[1];
$data = $args[2];
}
What I wanna do ,obviously, is to get all the strings between 'testng'
and 'blah'
$sql=select nfo_gname from galaxy_nfo limit 1;
$result=db_query($sql);
if ($result) {
while (list($nfo_gname)=mysql_fetch_row($result)) {
echo ($nfo_gname);
ereg (\[[a-zA-Z0-9]\], $nfo_gname, $regs);
echo $regs[1];
I'm trying to match any thing between [] and pull it from the string and
:[EMAIL PROTECTED]]
Subject: [PHP] regex pattern match and extract
$sql=select nfo_gname from galaxy_nfo limit 1;
$result=db_query($sql);
if ($result) {
while (list($nfo_gname)=mysql_fetch_row($result)) {
echo ($nfo_gname);
ereg (\[[a-zA-Z0-9]\], $nfo_gname, $regs);
echo $regs[1];
I'm
Im working on a site utilizing apaches/mysqp and of course php. Im
working through the basic framwork creating forms to collect user input
and do various searches etc. I was curious as to what most people find
the best way keep thier mysql queries from getting messed up by user
entered
I use a special function just for reforming input, but they use the
following bits with PCRE:
$replace_wordwhite = '/[^\w\s]/';
$replace_word = '/\W/';
$replace_num = '/\D/';
$replace_email = '/[^\w\-\.@]/';
Works pretty well and it's quite useful for killing useless input without
On Friday 30 March 2001 06:47, you wrote:
Ok, i have a text file with lines that looks like this:
14```value```value2`value3
This would be fine, except...there are sometimes more than in
other columns, so id like it to be
14``value``value2``value3
$new = preg_replace ('/`+/',
So as you seem to be good with regexps, can you tell me how i can write a
code that will search for next occurence in a string?
where pattern is a regexp and a string is long and ofcourse there will be
lots of pattern matchs in it...?
thanks
"Christian Reiniger" [EMAIL PROTECTED] wrote in
On Saturday 31 March 2001 00:07, you wrote:
So as you seem to be good with regexps, can you tell me how i can write
a code that will search for next occurence in a string?
where pattern is a regexp and a string is long and ofcourse there will
be lots of pattern matchs in it...?
What about
Ok, i have a text file with lines that looks like this:
14```value```value2`value3
This would be fine, except...there are sometimes more than in other
columns, so id like it to be
14``value``value2``value3
So I can explode() it into a mysql database. Can anyone offer a regexp for
It's a lame way, but it works,
I sure hope that someone can tell me how to do it in pure regexp.
like how can i 'search for next occurence' in ereg or any regexp() in PHP
-
?
$str = "14```value```value2`value3``hehe!``hohoho";
while ( ereg("[^`]+", $str, $result) )
{
$match =
On Thursday 08 March 2001 09:19, you wrote:
I'm putting together a regex to pull all of the urls out of a web page.
Not the href tag, but just the url part of that tag.
Here's what I've come up with:
preg_match_all('/.*href\s*=\s*(\"|\')?(.*?)(\s|\"|\'|)/i', $html,
$matches);
I'm putting together a regex to pull all of the urls out of a web page. Not
the href tag, but just the url part of that tag.
Here's what I've come up with:
preg_match_all('/.*href\s*=\s*(\"|\')?(.*?)(\s|\"|\'|)/i', $html,
$matches);
foreach($matches[2] as $m) print "P$m\n";
All regex masters
From: "Jerry Lake" [EMAIL PROTECTED]
I've tried and tried to no avail, can someone assist
I need to select the first space in a line like the following
Nelson Bob and Mary, 123 Street st., Ashton, 555-1212
I need to replace the space between Nelson and Bob with
a comma so I can separate
Try the perl compatible one, you can set a limit of how many times to
replace:
http://www.php.net/manual/en/function.preg-replace.php
I've tried and tried to no avail, can someone assist
I need to select the first space in a line like the following
Nelson Bob and Mary, 123 Street st.,
how do I select the first space after some alpha-numeric characters?
I can ^\D\s to get the characters and the space, but how can I select
the space only?
Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online -
Hello,
I need to take a string and remove everything from the first "" character
to the end of the line. I'm pretty sure I could do this with an
ereg_replace(), but I am horrible at regular expressions. Could anyone help
me with this?
- John Vandebreck
- Admin, GameDesign
--
PHP General
On Friday 23 February 2001 19:33, John Vanderbeck wrote:
I need to take a string and remove everything from the first ""
character to the end of the line. I'm pretty sure I could do this with
an ereg_replace(), but I am horrible at regular expressions. Could
anyone help me with this?
Guys/Gals:
For some reason too long to explane .. i have this site that i need to make
all the image names in an
image src all lowercase.. Here is what I have so far. Please someone tell
me what I am doing wrong.
?
$contents="img src=ThisOneReallyNeedsToBeAllLowercase.gif
You should either do this with ereg, or strtolower and not a combination of
the two, and in all actuality strtolower is specifically desinged to do this
very easily so I would go with it.
?
$contents="img src=ThisOneReallyNeedsToBeAllLowercase.gif
alt=ThisOneReallyNeedsToBeAllLowercase.gif";
Hi Christian,
function change_sess($html_code){
if(eregi("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}",$html_code)){
str_replace("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}","?=append_url()
;?", $html_code);
str_replace doesn't know about regular expressions, so it tries to find
the literal
601 - 700 of 733 matches
Mail list logo