Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,172 members, 7,821,974 topics. Date: Wednesday, 08 May 2024 at 11:14 PM

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

Nairaland Forum / Science/Technology / Programming / [Help Request] How Do I Use PHP Regular Expression Functions? (905 Views)

[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 requirements (2) (3) (4)

(1) (Reply) (Go Down)

[Help Request] How Do I Use PHP Regular Expression Functions? by nnomy3: 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: 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)

Creating Membership System / Pls I Need Help On This Vb.net Application / Life And Times Of Tech Billionaire Jason Li (no. 3)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.