php-general Digest 2 Aug 2012 10:16:30 -0000 Issue 7906

Topics (messages 318608 through 318613):

About Preg Match patterns
        318608 by: Tolga
        318609 by: Paul Halliday
        318610 by: Thiago Augusto
        318611 by: Daniel Brown
        318612 by: tamouse mailing lists
        318613 by: Marco Behnke

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message --- hi, i have a question, i dont know what keywords to search, so im asking here.

while using preg_match, there are lots of thing that can be written as $pattern.
for example:
preg_match("/php/i", "PHP is the web scripting language of choice.")

what is the meaning of  /i  ?
or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,

or this: /(?P<name>\w+): (?P<digit>\d+)/
/[^\\d\\sa-zA-Z$_]/
/^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u    (there is a extra "/u" )

#^http:\/\/(.*)\.(gif|png|jpg)$#i
#<head>(.*?)<\/head>#si

there is lots and lots of different usage of these.

my question is, where can i find a very detailed information about these ? i want and need to know whats what about these.

Thanks,
tolga.

--- End Message ---
--- Begin Message ---
On Thu, Aug 2, 2012 at 1:49 AM, Tolga <kacmazto...@gmail.com> wrote:
> hi, i have a question, i dont know what keywords to search, so im asking
> here.
>
> while using preg_match, there are lots of thing that can be written as
> $pattern.
> for example:
> preg_match("/php/i", "PHP is the web scripting language of choice.")
>
> what is the meaning of  /i  ?
> or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,
>
> or this: /(?P<name>\w+): (?P<digit>\d+)/
> /[^\\d\\sa-zA-Z$_]/
> /^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u    (there is a extra "/u" )
>
> #^http:\/\/(.*)\.(gif|png|jpg)$#i
> #<head>(.*?)<\/head>#si
>
> there is lots and lots of different usage of these.
>
> my question is, where can i find a very detailed information about these ? i
> want and need to know whats what about these.
>
> Thanks,
> tolga.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Take a look at this page:

http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

here is a little tool to play with different variations as well:

http://rubular.com/



-- 
Paul Halliday
http://www.pintumbler.org/

--- End Message ---
--- Begin Message ---
You are looking for "regular expression"

2012/8/2 Tolga <kacmazto...@gmail.com>

> hi, i have a question, i dont know what keywords to search, so im asking
> here.
>
> while using preg_match, there are lots of thing that can be written as
> $pattern.
> for example:
> preg_match("/php/i", "PHP is the web scripting language of choice.")
>
> what is the meaning of  /i  ?
> or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,
>
> or this: /(?P<name>\w+): (?P<digit>\d+)/
> /[^\\d\\sa-zA-Z$_]/
> /^[a-zA-Z\p{Cyrillic}0-9\s\-]+**$/u    (there is a extra "/u" )
>
> #^http:\/\/(.*)\.(gif|png|jpg)**$#i
> #<head>(.*?)<\/head>#si
>
> there is lots and lots of different usage of these.
>
> my question is, where can i find a very detailed information about these ?
> i want and need to know whats what about these.
>
> Thanks,
> tolga.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Thu, Aug 2, 2012 at 12:49 AM, Tolga <kacmazto...@gmail.com> wrote:
> hi, i have a question, i dont know what keywords to search, so im asking
> here.
>
> while using preg_match, there are lots of thing that can be written as
> $pattern.
> for example:
> preg_match("/php/i", "PHP is the web scripting language of choice.")
>
> what is the meaning of  /i  ?

    The /x character switch is called a regexp modifier.  In this
case, /i is for cAsE-iNsEnSiTiViTy.

> or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,

    To match a URL, insensitively, whether or not it contains http://.
 In this case, @ is used as the separator because of the slashes in
the protocol and path.

> or this: /(?P<name>\w+): (?P<digit>\d+)/
> /[^\\d\\sa-zA-Z$_]/
> /^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u    (there is a extra "/u" )
>
> #^http:\/\/(.*)\.(gif|png|jpg)$#i
> #<head>(.*?)<\/head>#si
>
> there is lots and lots of different usage of these.
>
> my question is, where can i find a very detailed information about these ? i
> want and need to know whats what about these.

    I'd recommend http://regular-expressions.info/, which is a really
handy site for regexp reference by users of all skill levels.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Wed, Aug 1, 2012 at 9:49 PM, Tolga <kacmazto...@gmail.com> wrote:
> hi, i have a question, i dont know what keywords to search, so im asking
> here.
>
> while using preg_match, there are lots of thing that can be written as
> $pattern.
> for example:
> preg_match("/php/i", "PHP is the web scripting language of choice.")
>
> what is the meaning of  /i  ?
> or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,
>
> or this: /(?P<name>\w+): (?P<digit>\d+)/
> /[^\\d\\sa-zA-Z$_]/
> /^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u    (there is a extra "/u" )
>
> #^http:\/\/(.*)\.(gif|png|jpg)$#i
> #<head>(.*?)<\/head>#si
>
> there is lots and lots of different usage of these.
>
> my question is, where can i find a very detailed information about these ? i
> want and need to know whats what about these.
>
> Thanks,
> tolga.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

The resources given are good, also, O'Reilly has a new book out
"Introducing Regular Expressions" in addition to their two previous
"Mastering Regular Expressions" and "Beginning Regular Expressions".

--- End Message ---
--- Begin Message ---
Am 02.08.12 06:49, schrieb Tolga:
> hi, i have a question, i dont know what keywords to search, so im
> asking here.
>
> while using preg_match, there are lots of thing that can be written as
> $pattern.
> for example:
> preg_match("/php/i", "PHP is the web scripting language of choice.")
>
> what is the meaning of  /i  ?
case-insensitive
http://de.php.net/manual/de/reference.pcre.pattern.modifiers.php
> or '@^(?:http://)?([^/]+)@i'  there are lots of chars here,
>
> or this: /(?P<name>\w+): (?P<digit>\d+)/
<name> and <digit> are subpattern names
http://de.php.net/manual/de/regexp.reference.subpatterns.php
> /[^\\d\\sa-zA-Z$_]/
> /^[a-zA-Z\p{Cyrillic}0-9\s\-]+$/u    (there is a extra "/u" )
utf-8
http://de.php.net/manual/de/reference.pcre.pattern.modifiers.php
>
> #^http:\/\/(.*)\.(gif|png|jpg)$#i
> #<head>(.*?)<\/head>#si
>
> there is lots and lots of different usage of these.
>
> my question is, where can i find a very detailed information about
> these ? i want and need to know whats what about these.
see http://de.php.net/manual/de/pcre.pattern.php
>
> Thanks,
> tolga.
>


-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz


Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

Reply via email to