I have noticed in the PHP regex library there is a choice between ereg and preg. What is the difference? Is one faster than the other and if so, why isn't the slower one deprecated?
Are there any situations where it is better to use one over the…
The PHP manual for split() says
This function has been DEPRECATED as
of PHP 5.3.0. Relying on this feature
is highly discouraged...Use explode()
instead.
But I can't find a difference between split() and explode(). join() hasn't been…
I have the following statement which worked fine before PHP 5.3 using the split function:
list($year, $month, $day, $hour, $min, $sec) = split( '[: -]', $post_timestamp );
After upgrading to PHP 5.3, I get the Deprecated warning:
Deprecated:…
I'm sorry to ask a question but I am useless when it comes to understanding regex code.
In a php module that I didn't write is the following function
function isURL($url = NULL) {
if($url==NULL) return false;
$protocol =…
Possible Duplicate:
How can I convert ereg expressions to preg in PHP?
I need help, below is a small VERY basic regex to somewhat validate an email, I do realize it does not work the greatest but for my needs it is ok for now.
It currently uses…
I'm getting the following message for some php I have to use but did not write:
Deprecated: Function ereg() is deprecated in /opt/lampp/htdocs/webEchange/SiteWeb_V5/inc/html2fpdf.php on line 466
This is line…
I am trying to create a regular expression using POSIX (Extended) Regular Expressions that I can use in my C program code.
Specifically, I have come up with the following, however, I want to exclude the word "http" within the matched expressions. …
I would like to use a regular expression like this in Java : [[=a=][=e=][=i=]].
But Java doesn't support the POSIX classes [=a=], [=e=] etc.
How can I do this? More precisely, is there a way to not use US-ASCII?
Introduction
I'm using Haskell's Text.Regex library and I want to match some characters that normally have meaning in regular expressions. According to Text.Regex's documentation,
The syntax of regular expressions is ... that of egrep (i.e.
POSIX…
I thought that in regular expressions, the "greediness" applies to quantifiers rather than matches as a whole. However, I observe that
grep -E --color=auto 'a+(ab)?' <(printf "aab")
returns aab rather than aab.
The same applies to sed.
On the…
I've have some luck with the following command:
git diff --color-words='[^][<>()\{},.;:?/|\\=+*&^%$#@!~`"'\''[:space:]]+|[][<>(){},.;:?/|\\=+*&^%$#@!~`"'\'']'
but it doesn't seem to negate the square brackets properly in the first character…
I am new to this regular exp concept. I am trying to use this reg ex
[^@\s]+$
If i give the string as "abs", its actulally excluding the character 's' . which means '\s' is read as a character 's' rather than a whitespace. Please help me to solve…