On 1 July 2010 06:47, Gaurav Kumar kumargauravjuke...@gmail.com wrote:
Hey Richard,
Thanks!!! You have resolved my problem..
GK
On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar
kumargauravjuke...@gmail.comwrote:
Hi All,
Need help in resolving the below problem-
I would like to get the
Not tested, but I think it should work:
preg_match_all('/(\d+),/', $postText, $matches);
--
João Cândido de Souza Neto
Gaurav Kumar kumargauravjuke...@gmail.com escreveu na mensagem
news:aanlktikdb_ismnkpomicxzsfzixg4dedznunrcimj...@mail.gmail.com...
Hi All,
Need help in resolving the
Hey Richard,
Thanks!!! You have resolved my problem..
GK
On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar
kumargauravjuke...@gmail.comwrote:
Hi All,
Need help in resolving the below problem-
I would like to get the whole comma separated string into an array value-
1. $postText = chapters
Shiplu wrote:
Sorry The previous code was wrong,
Its the correct version,
$x = a b;c d;e f;;
preg_match('/(?Pkeys\w) (?Pvalues\w)/',$x,$m);
print_r($m);
Now I am using backrefrence \1 in in ?P option like (?P\1\d+).
and I got the error.
thought I best update for courtesy sake; I spent a
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in
What's the complete row? e.g.,
trtdcharge/tdtd100/td/tr
Or, are there other td cells in the row?
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP
On 9/27/08, Nathan Rixham [EMAIL PROTECTED] wrote:
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP Warning: preg_match():
On 9/27/08, Al [EMAIL PROTECTED] wrote:
What's the complete row? e.g.,
trtdcharge/tdtd100/td/tr
Or, are there other td cells in the row?
No TD cells. forget the real world problem.
I made the exact replica of that. I need the sample work.
--
Blog: http://talk.cmyweb.net/
Follow me:
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP Warning: preg_match(): Compilation failed: syntax error after (?P
at offset 25 in
On 9/27/08, Nathan Rixham [EMAIL PROTECTED] wrote:
Shiplu wrote:
The string is tdcharge/tdtd100/td.
I want and array( charge=100).
I am using this regular expression,
'/td([^]+)\/tdtd(?P\1\d+)\/td/'.
But its not working..
I get this error.,
PHP Warning: preg_match():
Sorry The previous code was wrong,
Its the correct version,
$x = a b;c d;e f;;
preg_match('/(?Pkeys\w) (?Pvalues\w)/',$x,$m);
print_r($m);
Now I am using backrefrence \1 in in ?P option like (?P\1\d+).
and I got the error.
--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.com/shiplu
Jay Blanchard wrote:
Given the string 'foo''bar''glorp' (all quotes are single quotes)I had
hoped to find a regular expression using preg_match that would return an
array containing just those words without having to go through
additional gyrations, like exploding a string to get an array. I
First stripslashes() and all newlines [\n\r*]. It makes the regex much easier.
$pattern= %img\x20[\w\d\=\x20]+(src=\x20*\)([/\w\d\.]+)[\\x20]*/%i;
preg_match($pattern, $string, $match); If more than one in the string, use
preg_match_all().
Now print_r($match); so you can see the result.
Dave M G schrieb:
PHP,
Shouldn't this regular expression select everything from the start of
the string to the first space character:
$firstWord = preg_match('#^*(.*) #iU', $word);
It doesn't, so clearly I'm wrong, but here's why I thought it would:
The enclosing has marks, #, I *think*
Dave M G wrote:
PHP,
Shouldn't this regular expression select everything from the start of
the string to the first space character:
$firstWord = preg_match('#^*(.*) #iU', $word);
It doesn't, so clearly I'm wrong, but here's why I thought it would:
The enclosing has marks, #, I *think* just
Steve Turnbull wrote:
Hey folks
I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...
I have a string similar to the following;
cn=emailadmin,ou=services,dc=domain,dc=net
I want to extract whatever falls between the 'cn=' and the following
comma
Steve Turnbull wrote:
Hey folks
I don't want to just get you to do the work, but I have so far tried
in vain to achieve something...
I have a string similar to the following;
cn=emailadmin,ou=services,dc=domain,dc=net
I want to extract whatever falls between the 'cn=' and the following
comma
Barry wrote:
Simple reg help please
i want to match the last , in a,b,c,d and replace it with and
i tried ereg_replace(,([a-zA-z])*$, and ,$string);
but i forgot how to add the d which is also matched now back to the
and
Can you give any good reg_exp sites where to learn it?
Its long ago
babu wrote:
HI,
how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match.
thanks
babu
-
How much free photo storage do you get? Store your holiday snaps for FREE with
Yahoo! Photos. Get Yahoo! Photos
How about using the lower() function?
Leon Vismer wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
Jason wrote:
Simple functions to check fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
?php
/*
* ex. 00:AA:11:BB:22:CC
*/
function chk_mac( $mac ) {
Hi,
From what i can see you dont even need to call global, as your passing
variables to the function ? this could be causing the script to
confuse itself.
hth
On Fri, 21 Jan 2005 09:30:21 -0700, Jason [EMAIL PROTECTED] wrote:
Jason wrote:
Simple functions to check fix if necessary invalid
You were right, I removed the reference to global $mac and it started
working great. Thanks. It seems sometimes another set of eyes to catch
stuff really helps... thanks.
Jason wrote:
Jason wrote:
Simple functions to check fix if necessary invalid formating of a
MAC address... I seem to be
On Wed, 24 Nov 2004 13:17:48 -0500, Ankur Os wrote:
Hi,
This is quite simpal problem that i want to made regular expression which
can read this kind of structure...
a,b,c
not like this
1. ,a,a,a
2. a,,,aa,,
3. a,a,a,,,
means simpal structure with comma (a,b,c...)
Hi,
Try
I suggest not using a regex.
There are better tools for parsing an email, for example formail.
$email = `formail -x Return-Path`;
See google.com for more information
Regards,
Aidan
Syed Ghouse [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi All
will anyone give me a solution to
If you still like to gather the information without using any tools:
$email = explode( \n , $mailText );
foreach ( $email AS $emailLine ) {
$emailLine = trim( $emailLine );
if ( strtoupper ( substr( $emailLine , 0 , 4 ) ) == 'FROM' ) {
preg_match( '#^from\s*:\s*([^]+)(([^]+))?#si'
- Original Message -
From: Syed Ghouse [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 30, 2004 PM 04:43
Subject: Re: [PHP] Re: Regular expression
Thanks Aiden for ur help
i used ur code and i got
name as Red Wingate[EMAIL PROTECTED]
and no email.
So pls correct
First of all check who u credit :p
Secondly why don't you just try to fix it yourself?
There was just a typo in the regexp:
- #^from\s*:\s*([^]+)(([^]+))?#si
+ #^from\s*:\s*([^]+)(([^]+))?#si
Hopefully this will help you even more:
?php
/**
* @param string $runlevel
* @return mixed
*/
Yeah i used ur coding below and i got the solution for my problem.
Thanks Aidan
Syed
- Original Message -
From: Syed Ghouse [EMAIL PROTECTED]
To: php mailinglists [EMAIL PROTECTED]
Sent: Wednesday, June 30, 2004 PM 04:45
Subject: Fw: [PHP] Re: Regular expression
- Original
* Thus wrote Red Wingate:
First of all check who u credit :p
Secondly why don't you just try to fix it yourself?
There was just a typo in the regexp:
- #^from\s*:\s*([^]+)(([^]+))?#si
+ #^from\s*:\s*([^]+)(([^]+))?#si
Hopefully this will help you even more:
You're too nice..
Btw, I
Oh ... you forgot to include your account-info so i won't be able to
send you the money :-/
[...]
You're too nice..
Btw, I need some money. Send me money ASAP. It must be an amount
greater than $200, and be delivered to me directly, thank you.
[...]
--
PHP General Mailing List
This should work:
^\\ # Don't match if a backslash precedes
\[ # Open bracket
([^\]]+?) # Text, including whitespace
\] # Close bracket
By the way, using a tool called The Regex Coach I solved your problem in
about 10 seconds. For those having regex problems you might
Because the substrings can contain any char-s including
commas. Also I use reg exp not for splitting only but
for validating whether whole string and the substrings
are correctly formatted. Using reg exp requires much less
coding than traditional programming.
Why not just strip out the braces
Forgot about curly brackets. The above example is:
/^\{(?:(pattern),)*|(pattern)?\}$/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Wed, May 05, 2004 at 02:26:25PM +0900, Tumurbaatar S. wrote:
There's an input string like {str1,str2,...,strN}. I want to capture
all these strings and due to complexity of them I use a preg_match_all()
instead of simple split. A pattern for the matching strings is ready but
I cannot
an excelent tool: The Regex Coach, its free and you can grab it from
http://weitz.de/regex-coach/
and its available for windows and linux!
luis.
[EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
Hello all,
For a while I tried in vain to find a decent regular expression tester.
* Jas [EMAIL PROTECTED]:
Not sure if anyone knows of a good way to match strings of this type...
00:02:8b:0c:2f:09
I have tried this but its not working.
Hello
If you simply want to check if the fields contains Po BOX simply use the
stripos function or one of the other string functions. They should be
faster than reg ex.
If you still want to use reg ex I suggest using preg_match since it is
faster than ereg.
About your regex:
It will not find
I figured out what I was doing wrong. My regexp should of looked like
this /a[^]*(Tampa)\/a/ and that made it more specific and kept it
to that match.
Jason Lehman wrote:
I have a script that turns certain words into links. That I am having
no problems with, it is when I want to turn the
perl: preg_match
'/a\s*href/s*=/s*[\']?[^\']+[\']?/i'
or eregi
'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?'
--
Regards,
Noodle Snacks [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
what would be a simple regular expression for a href=anythinghere?
for future
Thanks.
Ns_andy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
perl: preg_match
'/a\s*href/s*=/s*[\']?[^\']+[\']?/i'
or eregi
'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?'
--
Regards,
Noodle Snacks [EMAIL PROTECTED] wrote in message
[EMAIL
$str = jeD1GLal;
$str = ereg_replace([1LIO0lio], , $str);
something like that...
On Fri, 30 Aug 2002, Jeff Lewis wrote:
Is there a regular expression that will remove 1, L, I, O, 0 and the
lowercase equivilants from a varialbe?
I am not horribly well versed in regular expressions...so I'm
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Henry) wrote:
I'm looking for a simple was to correct a list of proper nouns given all in
lower case!
For example
given $string=london paris rome;
I would like London Paris Rome.
However there is one cavet; if the word already has a
preg_match(/body\s([^]*)/i, $html, $args);
$body_props = $args[1];
preg is much faster/better than ereg.
note the /i at the end of the preg, that makes it case insative, drop the i
if you want it to be case sensative on the match.
-Joe
John Monfort [EMAIL PROTECTED] wrote in message
[EMAIL
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Adam Whitehead) wrote:
if ((ereg([^[:alnum:]],$fn)) || (ereg([^[:alnum:]],$sn))) {
// Do something here
}
What it's doing is checking two variables to make sure they contain only
alphanumeric characters.
I have a requirement that
Hello,
Galkov Vladimir [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Need to remove all ../ /.. from user inputing string to prevent him
walking and creating filesdirectories where I don't whant see them/him...
The string:
$path =
Whooops,
Pasted wrong line. This should do it:
$string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string);
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list
Whooops,
Pasted wrong line. This should do it:
$string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string);
Gah... Not.. enough... caffeine: Modification:
$string = preg_replace(/(\.*\/)+(.*?\.*\/)?(\.*)?/s, , $string);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
This should do (but ofcourse you might want to play a bit with it)
$mem =
'
A HREF=http://www.mydomain.com/mypage.php;something/a is fine
A HREF=http://www.yourdomain.com/yourpage.php;something/a is wrong
A HREF=http://www.yourdomain.com/yourpage.php;something/a is finebr
a
here's your PHP code,
?
$mem = '
table cellspacing=2 cellpadding=2 border=1
tr
td align=centerbanana/td
td align=left.46/td
td align=right.55/td
/tr
tr
td align=centerpear/td
td align=left.38/td
td align=right.51/td
/tr
tr
td align=centerapple/td
td
Actually I didn't pose my question correctly.
I also needed to grep out the Link for use in JS during the process.
I wrapped this in a class file and here is the entry that I ended up with.
Thanks for the assist though...
==
function
blah blah blah blah blah Link blah blah blah blah Link
I think I need to use eregi_replace to make the line look like this:
blah blah blah blah blah a href='#'Link/a blah blah blah blah a
href='#'Link/a
Depending on how accurately you have stated the problem, this may work:
$text = 'blah
Clayton Dukes wrote:
Okay, here's what I have so far:
---snip---
if ((!$email)
|| ($email==)
|| (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email))
)
$stop = center._ERRORINVEMAIL./centerbr;
---snip---
This works, but how can I add a second domain?
ie:
Try:
On Fri, 29 Jun 2001 23:43, Clayton Dukes wrote:
Okay, here's what I have so far:
---snip---
if ((!$email)
|| ($email==)
|| (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email))
)
$stop = center._ERRORINVEMAIL./centerbr;
---snip---
This works, but how can I add a
Okay, here's what I have so far:
---snip---
if ((!$email)
|| ($email==)
|| (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email))
)
$stop = center._ERRORINVEMAIL./centerbr;
---snip---
This works, but how can I add a second domain?
ie:
---snip---
if ((!$email)
||
56 matches
Mail list logo