₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,363 members, 8,421,554 topics. Date: Saturday, 06 June 2026 at 04:05 PM

Toggle theme

[Help Request] How Do I Use PHP Regular Expression Functions? - Programming - Nairaland

Nairaland ForumScience/TechnologyProgramming[Help Request] How Do I Use PHP Regular Expression Functions? (989 Views)

1 Reply (Go Down)

[Help Request] How Do I Use PHP Regular Expression Functions? by nnomy3(op): 1:13pm On Oct 16, 2012
I want in detail how to use functions for checking regular expressions...kinda confused there...thanks
Re: [Help Request] How Do I Use PHP Regular Expression Functions? by Nobody: 1:44pm On Oct 16, 2012
Am Sorry brother but you need to get indepth knowledge with Regular Expression first before using PCRE Function in PHP, try this.
http://www.noupe.com/php/php-regular-expressions.html

This is something you must learn on your own to understand its very confusing.
Re: [Help Request] How Do I Use PHP Regular Expression Functions? by nnomy3(op): 2:09pm On Oct 16, 2012
pc guru: Am Sorry brother but you need to get indepth knowledge with Regular Expression first before using PCRE Function in PHP, try this.
http://www.noupe.com/php/php-regular-expressions.html

This is something you must learn on your own to understand its very confusing.
Not a "brother". Thanks anyways
Re: [Help Request] How Do I Use PHP Regular Expression Functions? by Nobody: 2:30pm On Oct 16, 2012
The easy way is that Regular Expression uses the Expression you pass to check against the String and return items that have met the Criteria. e.g

preg_match('/^hello/i', $test_string);

in Regular Expression "/" is used to surround the expression even in javaScript they are called RegExp Objects, "^" means it must start with a character followed after it, and "i" means case insensitive and the "g" would also mean Global.



so that code will match hello exactly
Re: [Help Request] How Do I Use PHP Regular Expression Functions? by Nobody: 2:32pm On Oct 16, 2012

preg_match('/^[A-Za-z0-9]{5}/', $test_string); The "[]" will catch a set of characters mean A-Za-z to 0-9


This will catch any Alphanumerical characters except whitespace and . that are at least five characters, the link i sent was one of the easiet i have encountered,also download the PHP Manual a lot of examples are there.
1 Reply

[Help Request] Help On Java download and Installation Oo![Help Request] Help With Database Connectivity Error[Help Request ] I Want To Learn Programming, what are the requirements234

Am Still Up Coming And I Want To Be A Software ProgramerFree It Video For Cartoon Animation With The Software For Ibadan People.Help Deploying Liferay Portlet