Is it because I learned from Perl? However, Perl is a language embedded with regular expressions. It is natural to use separators to indicate regular expressions. Since PHP uses preg functions, why do I need separators? Function processing is also used in Python (provided by the re module) without separators. {Code...} Haskel... is it because of learning from Perl? However, Perl is a language embedded with regular expressions. It is natural to use separators to indicate regular expressions. PHP is used
preg
Why do you need separators for Series function processing?
In Python, function processing is also used (re
Module), no separator is required.
pattern = re.compile("foo")
In HaskellText.Regex.Posix
You do not need to use separators.
"my left foot" =~ "foo" :: Bool
Interestingly, PHP 5.3 is obsolete.ereg
Series functions do not contain delimiters:
eregi("(ozilla.[23]|MSIE.3)", $_SERVER["HTTP_USER_AGENT"]);
Sopreg
When designing a series of functions as pattern, you need to add delimiters. What is the purpose?
Reply content:
Is it because I learned from Perl? However, Perl is a language embedded with regular expressions. It is natural to use separators to indicate regular expressions. PHP is usedpreg
Why do you need separators for Series function processing?
In Python, function processing is also used (re
Module), no separator is required.
pattern = re.compile("foo")
In HaskellText.Regex.Posix
You do not need to use separators.
"my left foot" =~ "foo" :: Bool
Interestingly, PHP 5.3 is obsolete.ereg
Series functions do not contain delimiters:
eregi("(ozilla.[23]|MSIE.3)", $_SERVER["HTTP_USER_AGENT"]);
Sopreg
When designing a series of functions as pattern, you need to add delimiters. What is the purpose?
Some pattern modifiers can be added with separators.m
,u
,i
,s
And so on. How can I add a separator without it? Andpreg
The series followsPCRE
Series, so followPCRE
Some basic rules,POSIX
Do not use separators. In additionpreg
Series andperl
There are some differences, so it should not beperl
Learn it.
References:
Differences between PCRE and perl
Differences between PCRE and POSIX Regular Expressions
Available pattern modifiers in Regular Expressions