>
>$str = 'hi my friend! this message uses html entities href="http://www.trini0.org";>test!';
>$str = preg_replace('/(.*<\/a>)/',
>htmlspecialchars("$1"), $str);
Maybe I'm missing something here, but can't you just do:
$str = htmlspecialchars($str);
--
Like Music? http://l-i-e.com/artists.
Hello,
On 07/28/2002 05:02 PM, Mike Mannakee wrote:
> Does anyone have a regular expression that works to validate credit card
> numbers?
No, there is not regular expression for that. You may want to use this
class instead for validation credit card numbers in forms:
http://www.phpclasses.org/
Hi Richard:
On Mon, Jul 29, 2002 at 05:02:49AM -0500, Richard Lynch wrote:
>
> For starters, if Perl wants \ PHP needs \\ since \ is special in both
> languages.
I'm curiuos what you're talking about. The manual says nothing about this
in the PCRE section:
Example 1. Examples of valid patte
>Does anyone have a regular expression that works to validate credit card
>numbers?
http://php.net/links.php
has links to code archives that will give you tons of them.
Ditto for the phone numbers post I'm about to read.
NOTE: Making users not be able to use phone numbers like 1-800-MY-STUFF
>I'm using a regular expression (below) to check phone numbers. I'm getting
>an error that I can't make sense of.
>
>$regex = "^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$";
>
>Output I'm getting =
>Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28
>
>Anyone know what this m
>i have something like
>$str = "sometext sometext [emoticon01] sometext [emoticon23] sometext";
>
>i would like to use regex to replace those codes into:
>sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext
>
>all numerics after the code "emoticon" consisted of exactly 2 d
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message...
> > How can I regex to compare the last three chars of a string to "php"?
>
> if (substr($foo, -3) == 'php'){
> }
>
> Oh, wait, you wanted to use RegEx. Sorry, can't help you there. :-)
>
> Don't use a cannon to swat a fly.
probably a good
as a preg "/(...)$/"
this gives you the last three chars..
--
===
Michael J. Ryan - tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net
=
> How can I regex to compare the last three chars of a string to "php"?
if (substr($foo, -3) == 'php'){
}
Oh, wait, you wanted to use RegEx. Sorry, can't help you there. :-)
Don't use a cannon to swat a fly.
--
Like Music? http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://
What d'ya know. I should read the manual more regularly.
http://www.php.net/manual/en/function.preg-quote.php
~J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Berber,
you generally need to do some string replacements on the text you're using
to put through the match before you actually do the match (and same for
replacements). Just have a look at the pattern syntax in the manual for the
characters you need to do the replacement on... e.g
$string =
Hello James,
"James Taylor" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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 o
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Paul A. Procacci) wrote:
> ticket_id=3&change_name=status&change_value=3&ticket_id=3&2=&1=&
>
> And all I want is 2=&1=&. Well, the closest I came was :
>
> $string = preg_replace("/[^0-9]+\=/", "", $QUERY_STRING); Assuming
> QUERY_STRING w
$sNoSpaces = ltrim($variable);
if ('*' == $sNoSpaces[0])
--
Regards,
--
Calin Uioreanu
[EMAIL PROTECTED]
Tel: +49 - (0) 89 - 25 55 17 23
http://www.ciao.com
--
"Leon Mergen" <[EMAIL PROTECTED]> wrote in
Hello Leon,
try this
if (preg_match("/^([[:space:]]*)?\*/s", $string)) {
echo "Match.";
} else {
echo "No match";
}
James
"Leon Mergen" <[EMAIL PROTECTED]> wrote in message
002f01c15d2a$e4ca3030$012aa8c0@leon">news:002f01c15d2a$e4ca3030$012aa8c0@leon...
Hi there,
I am camping with a little
[EMAIL PROTECTED] (Stefen Lars) writes:
> In the Apache config file, we have the following directive:
>
> SetEnvIfNoCase Referer "^http://www.oursite.com/"; local_ref=1
>
>
> Order Allow,Deny
> Allow from env=local_ref
>
>
> We use this to prevent people from directly linking to .gif and
You're making your expressions too complicated. To test for just that
string,
eregi("HTTP/1\.[01] 302", $output)
should work.
Later,
Sterling
Boaz Yahav wrote:
> 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 w
> thinking it may be easier to parse for only allowed characters.
*much* better idea. Try:
preg_match('/[^\w]/', $string)
to find all non-alphanumeric+underscore
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Dave) wrote:
> Cannot seem to get a regex to check a string for the following
>
> space tab ' " ! @ # $ % ^ & * ( ) + = : ; / \
>
> if(preg_match('[\'" ,!@#$%\^&*()+=:;/\\]',$mystring))
You need pattern delimiters with preg_* expression
You could do it using the strpos() function to find the index of the first
occurance of "" and strrpos() for the last occurence. Then use
substr() to grab what you want...
On Mon, 16 Jul 2001, Julian Simpson wrote:
> I'm trying to parse an existing html file using php.
> I need to use regex to
101 - 120 of 120 matches
Mail list logo