regular expression
Moderator: General Moderators
Re: regular expression
the echo statement shows all the character.so the problem should be in DB. what is the character limit for the field in DB?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: regular expression
Not sure what you want, but you are replacing all of those characters plus all characters a-z and A-Z, why? Try:
I don't know how the i modifier works with those though.
Code: Select all
$newString = preg_replace('/[àâçéèêëîïôûùüÿ]/i', ' ', $text);mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: regular expression
.
Last edited by Rahul Dev on Fri Feb 25, 2011 1:10 am, edited 1 time in total.
Re: regular expression
.
Last edited by Rahul Dev on Sun Feb 27, 2011 1:59 am, edited 1 time in total.
Re: regular expression
my field limit is 10000 it still stores only part of the stringanantha wrote:the echo statement shows all the character.so the problem should be in DB. what is the character limit for the field in DB?
Re: regular expression
Try using the u modifier
(just a guess)
(just a guess)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: regular expression
Actually, when you echo $newString2 it comes out fine.
So the problem is inserting into your database.
What is the database collation of your database and table?
So the problem is inserting into your database.
What is the database collation of your database and table?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: regular expression
.
Last edited by Rahul Dev on Sun Feb 27, 2011 1:59 am, edited 1 time in total.
Re: regular expression
The code to check the email using Perl compatible regular expression looks like this:
1. $pattern = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/";
2.$email = "jim@demo.com";
3.if (preg_match($pattern,$email)) echo "Match";
4.else echo "Not match";
And very similar in case of POSIX extended regular expressions:
1.$pattern = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$";
2.$email = "jim@demo.com";
3.if (eregi($pattern,$email)) echo "Match";
5. else echo "Not match";
web designers
1. $pattern = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/";
2.$email = "jim@demo.com";
3.if (preg_match($pattern,$email)) echo "Match";
4.else echo "Not match";
And very similar in case of POSIX extended regular expressions:
1.$pattern = "^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$";
2.$email = "jim@demo.com";
3.if (eregi($pattern,$email)) echo "Match";
5. else echo "Not match";
web designers