I have tried numerous variations, but my regex skills suck! I would
appreciate anyone who can give me a pattern to use in preg_match_all() to
match the following (I have the first part up to ANYTHING working):
'|function ([\w\d\_]+)\((.*)\)ANYTHINGreturn (ANYTHING);|'
So parsing a PHP file I
My regex skills are serious lacking and after scouring the net for
relevant links I'm a bit stuck. I've got a textarea field where I pull
user input from, and I'd like to search this entire field for a Windows
Directory Path (ex. C:\Documents\Blah).
Basically my users are allowed to specify
if(preg_match('/img[^]+src[ ]*=[ ]*(||\')[a-z]{1}:\\\/i', $string))
echo local links used;
[EMAIL PROTECTED] wrote:
My regex skills are serious lacking and after scouring the net for
relevant links I'm a bit stuck. I've got a textarea field where I pull
user input from, and I'd like to search
My regex skills are serious lacking and after scouring the net for
relevant links I'm a bit stuck. I've got a textarea field where I pull
user input from, and I'd like to search this entire field for a Windows
Directory Path (ex. C:\Documents\Blah).
if(preg_match('/img[^]+src[ ]*=[
I do not know if this is the right list, but if someone could help me with
the following
I need a function that does this:
function phone($num) {
take num and remove anything that is not a number
ex: () - /
If there is not 1 at the start, add a one to the start of the number.
make sure
Untested:
function fixhisnumber($str){
//remove all but numbers
$str = preg_replace(/[^0-9]/,,$str);
//append 1, unless it's already there
$str = $str[0] == '1'? $str:1.$str;
if (strlen($str) == 10) return $str;
else return -1;
}
Mohamed~
On Fri, 2003-10-10 at 14:01, Lists wrote:
I do not
On 01 October 2003 21:02, [EMAIL PROTECTED] wrote:
1. The PHP manual sais to escape the escape char, it has to
be written
twice*, but:
Yes, it does. But it also says that to put a \ into a string, you need to
write it twice (escape it) ***. So:
$term = preg_replace('/(\\)/', 'backslash
Ooops, forgot the footnote:
***
http://www.php.net/manual/en/language.types.string.php#language.types.string
.syntax
Cheers!
Mike
-
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning
Regular Expressions: How can I indicate that the contents of a term
(user input*) needs to be treated as 'non-operators/control characters'
(as *word* to match in that exact way)?
(* Because the term is a user's input I can't escape the control
characters manually.)
Example:
$result =
You can escape the control characters manualy ;)
$termWithOptionalBold=str_replace(array('.','\','$'
),array('\.','\\','\$' ), $termWithOptionalBold);
[EMAIL PROTECTED] wrote:
Regular Expressions: How can I indicate that the contents of a term
(user input*) needs to be treated as
From: [EMAIL PROTECTED]
Regular Expressions: How can I indicate that the contents of a term
(user input*) needs to be treated as 'non-operators/control characters'
(as *word* to match in that exact way)?
(* Because the term is a user's input I can't escape the control
characters
1. The PHP manual sais to escape the escape char, it has to be written
twice*, but:
$term = preg_replace('/(\\)/', 'backslash $1', $term);
causes an error** while using three backslashes (see 2.) works.
2.1.
$term = beg \ end;
print preg_replace('/(\\\)/', 'backslash $1', $term);
returns: beg
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
on Wednesday, October 01, 2003 1:02 PM said:
Does this make ANY sense?
Seeing as how you haven't had a response yet, I'll ask this: what
exactly is your question? I'm not sure as to what it is that you want.
c.
--
PHP General Mailing List
Am Mittwoch, 01.10.03 um 22:27 Uhr schrieb Chris W. Parker:
Seeing as how you haven't had a response yet, I'll ask this: what
exactly is your question? I'm not sure as to what it is that you want.
My question are:
a) Why does the PHP manual say that backslashes get escaped by writing
them twice
* Thus wrote jonas_weber @ gmx. ch ([EMAIL PROTECTED]):
Am Mittwoch, 01.10.03 um 22:27 Uhr schrieb Chris W. Parker:
Seeing as how you haven't had a response yet, I'll ask this: what
exactly is your question? I'm not sure as to what it is that you want.
My question are:
a) Why does the PHP
Dear List,
I´m writing a little framework with special features for my application. The
content of my Website is in HTML-Pages from other users working with
HTML-Editors.
I parse the content in their body in my framework.
now I have to replace the content of their links from a
Hi there,
I have a regex problem.
Basicly I do not want to match:
/dir/test/contact.html
But I do want to match:
/test/contact.html
I tryed this one:
^[!dir]/(.*)/contact(.*).html$
but it does not work and I tryed thousands of other ways plus read
tutorials.
Can anybody please help?
Thanx
On 15 August 2003 12:02, Merlin wrote:
Hi there,
I have a regex problem.
Basicly I do not want to match:
/dir/test/contact.html
But I do want to match:
/test/contact.html
I tryed this one:
^[!dir]/(.*)/contact(.*).html$
Well, that's not going to work because the construct
nop.. that does not work either.
It does not execute for a url like: /test/contact.html
The regex should execute for
/test/contact.html
but not for /partner/test/contact.html
where test should be open for any word
Any other suggestions? I am sure this is possible.
Merlin
-- arek Kilimajer
try
RewriteRule ^!partner/([^/]*)/contact([\.]*).html$ profiles?modrew_fa=6
Merlin wrote:
Hi there,
I am having trouble with a reg ex.
What it should do is, terminate if the url is /*/contact.html
but it should not terminate if it is /partner/*/contact.html
where * stands for any value
I
Hi there,
I am having trouble with a reg ex.
What it should do is, terminate if the url is /*/contact.html
but it should not terminate if it is /partner/*/contact.html
where * stands for any value
I tryed:
RewriteRule ^!partner/(.*)/contact(.*).html$ profiles?modrew_fa=6
but obviously the
I am trying to get a regex to extract the Some and more text
between the para elements below in a single pass for style attribute of
heading 2
para font-size=12 font-family=Arial style=heading 2Someanchor
type=bkmrk/more text-/para
para font-size=12 font-family=Arial style=heading 2inline
Message -
From: David Pratt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 10:55 AM
Subject: [PHP] Regex help appreciated
I am trying to get a regex to extract the Some and
more text
between the para elements below in a single pass for
style attribute of
heading 2
Can't seem to get this to work...
trying to yank stuff xxx from
TD class=a8b noWrap align=middle width=17 bgColor=#ccxxx/TD
and stuff yyy from
TD class=a8b noWrap width=100nbsp;yyy/TD
preg_match(nbsp;(.*)/TD$|i, $l, $regs);
works for the second example, even though it isn't the correct
Can't seem to get this to work...
trying to yank stuff xxx from
TD class=a8b noWrap align=middle width=17 bgColor=#ccxxx/TD
and stuff yyy from
TD class=a8b noWrap width=100nbsp;yyy/TD
preg_match(|nbsp;(.*)/TD$|i, $l, $regs);
works for the second example, even though it isn't the correct
Hello,
This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at
08:59, lines prefixed by '' were originally written by you.
Can't seem to get this to work...
trying to yank stuff xxx from
TD class=a8b noWrap align=middle width=17
bgColor=#ccxxx/td
Try this:
Hello,
Well I am doing by first reg ex operations and I am having problems which I just
cannot figure out.
For example I tried
echo eregi_replace (tr bgcolor=\#F8F8F1\(\s*)td\s*font
size=\2\\s*purchasing power parity, '%POWER%', 'tdtrsdsdsstr
bgcolor=#f8f8f1tdfont size=2Purchasing power
Has anyone had any success with using variables in a regex shown below??
$foo = 3;
$bar = 4;
preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}$/', $some_string)
or even
preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/',
$some_string)
but this would work
Gerard Samuel [EMAIL PROTECTED] wrote:
Has anyone had any success with using variables in a regex shown below??
$foo = 3;
$bar = 4;
preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}$/', $some_string)
You have single quotes, so php wont expand the variables inside.
or even
Curt Zirzow wrote:
Gerard Samuel [EMAIL PROTECTED] wrote:
or even
preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/',
$some_string)
that should work.
Unfortunately it doesn't for some reason. Don't know why.
but you could do this:
$pattern =
Sid [EMAIL PROTECTED] wrote:
Hello,
Well I am doing by first reg ex operations and I am having problems which I just
cannot figure out.
For example I tried
echo eregi_replace (tr bgcolor=\#F8F8F1\(\s*)td\s*font
size=\2\\s*purchasing power parity, '%POWER%', 'tdtrsdsdsstr
Gerard Samuel a écrit:
Curt Zirzow wrote:
Gerard Samuel [EMAIL PROTECTED] wrote:
or even
preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar .
'}$/', $some_string)
I think, you Forgot, a \ before the $ at the end of the expression...
that should work.
Unfortunately it doesn't
i need to uses reg ex to change a href=url to a href=url
target=_blank
the brackets have to be represented using lt; and gt;
I have tried so many ways, but none work. here is an example of my
faliure.
$body =
preg_replace(/(href=\/?)(\w+)(gt;\/?)/e,'\\1'.'\\2'./'target=_blank/
'.'\\3',
I have a string something like -
[TIT2] ABC [TPE1] GHI [TALB] XYZ
Im applying a regex as such -
// Title/Songname/Content
preg_match('/\[TIT2\](.*?)(\[)?/', $foo, $match);
$title = trim( $match[1] );
The above regex doesn't work. At the end of the pattern Im using (\[)?
The pattern may or may not
Some delimiters chars don't work under windows.
Ex.:
°[a-z]?°
works on linux but on windows you get a warning:
Warning: Unknown modifier '?' in on line xx
/[a-z]?/
works on both systems
So my question is: Are there similar problems in other functions or
circumstances where such chars
On 17-Jun-2003 Ron Dyck wrote:
I need to match text between two html comment tags.
I'm using: preg_match(/!--start_tag--(.*)!--end_tag--/, $data,
$Match)
Which work fine until I have carriage returns. The following doesn't
match:
Use the m (multiline) modifier:
Hello
Two things:
First wouldn't it be faster to use strpos and substr if you simply have to
find the literate !-- start_tag -- and !-- end_tag --.
Second: If you use your regex and you have something like
!-- start_tag -- This is some text to grasp!-- end_tag -- this is
text I don't want !--
I need to match text between two html comment tags.
I'm using: preg_match(/!--start_tag--(.*)!--end_tag--/, $data, $Match)
Which work fine until I have carriage returns. The following doesn't match:
!--start_tag-- Nullam auctor pellentesque sem. Aenean semper. Aenean magna
justo, rutrum et,
. matches any character except newline by default, use s modifier:
preg_match(/!--start_tag--(.*)!--end_tag--/s, $data, $Match)
Ron Dyck wrote:
I need to match text between two html comment tags.
I'm using: preg_match(/!--start_tag--(.*)!--end_tag--/, $data, $Match)
Which work fine until I have
Im trying to pull the Mozilla version and *possibly* the MSIE x.xx
string out $_SERVER['HTTP_USER_AGENT']
If I did this correctly, (MSIE\s\d\.\d{1,2})? should mean that if its
there pull it out, else move on, since its not there.
When viewing this script via a windows browser, it doesn't match
I'm using this snippet to turn line breaks into br tags:
preg_replace(/(\015\012)|(\015)|(\012)/,br\n,$page['CONTENT']);
It works fine, but I'd like it to ignore text between ignore
/ignore tags.
andrew
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hello,,
I have a preg_match issue matching numbers. I am currently using
!preg_match ('/([0-9\-\.\#:])/', $_POST['nums1']
throw error[]
This fails if you use something like ' asdf ' but if you use ' asdf789 ' it passes
false and does not throw an error.
This is not the obvious
]
Sent: Saturday, May 31, 2003 11:46 AM
Subject: [PHP] regex problem
Hello,,
I have a preg_match issue matching numbers. I am currently using
!preg_match ('/([0-9\-\.\#:])/', $_POST['nums1']
throw error[]
This fails if you use something like ' asdf ' but if you use ' asdf789 ' it
passes false
: Saturday, May 31, 2003 6:04 PM
Subject: Re: [PHP] regex problem
Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, :
Is this what you are trying to match. if so, try this.
if ( preg_match(/[^0-9\#\:\.\-]/, $_POST['nums1']) ) {
throw error()
}
This will match
hi,
i need to search $final_footer for a string such as
%INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and
delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just
/path/to/file)
im new to regexps but im guessing I should use preg_match for this?
Can
Try this (entirely untested!):
$final_footer =
preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer);
Nate wrote:
hi,
i need to search $final_footer for a string such as
%INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and
delete it from the string. it being
Thanks! That worked almost. It removed everything except for the 2 %
signs.
How might I remove those as well?
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
Try this (entirely untested!):
$final_footer =
preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer);
Thanks! That worked almost. It removed everything except for the 2 %
signs.
How might I remove those as well?
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Try this (entirely untested!):
$final_footer =
preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer);
Whoops! Try this:
preg_replace('|%INCLUDE_FILE\\[[^\\]]*\\]%|','',$final_footer);
Nate Sanden wrote:
Thanks! That worked almost. It removed everything except for the 2 %
signs.
How might I remove those as well?
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Try
Worked great. Thanks so much.
Leif K-Brooks [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Whoops! Try this:
preg_replace('|%INCLUDE_FILE\\[[^\\]]*\\]%|','',$final_footer);
Nate Sanden wrote:
Thanks! That worked almost. It removed everything except for the 2 %
signs.
How
suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);
I would like to get an output of all possible combinations of the
sentence
with the words between brackets:
eg.
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot
hi,
suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);
I would like to get an output of all possible combinations of the sentence
with the words between brackets:
eg.
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot
suppose there's a string
$string=I like my(hot) coffee with sugar and (milk)(PHP);
I would like to get an output of all possible combinations of the sentence
with the words between brackets:
eg.
I like my hot coffee with sugar and
I like my hot coffee with sugar and milk
I like my hot
Hi folks,
I'm looking for a regular expression which matches a URL. I've found
several already by looking around various sites, but they don't seem
to accomplish what I'm looking for.
I'm developing a PHP-driven message board / forum system. As a part
of this, of course, I have to give users the
I've been attempting to figure out regex, and I've realized I need to start
over from scratch. And get lots of help!
I'm inputting a text file containing html which will contain this:
a href=/q?s=IBMd=tIBM/a/font/tdtd nowrap align=center
font face=arial size=-12:59pm/font/td
td nowrapfont
I'm using the following to try and replace urls in my html output:
$newhrefs = preg_replace(/script.php\?(.*)=(.*)(.*)=(.*)(.*)=(.*)/,
script-$1-$2-$3-$4-$5-$6.html, $hrefs);
This works fine as long as there are exactly 3 var=val pairs... not 1 or 2
or 4 or more...
How can I write my expression
At 07:47 11.02.2003, Lord Loh. said:
[snip]
I am new to regex and broke my head on it the other day...in vain...
Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?
This one time, at band camp,
Lord Loh. [EMAIL PROTECTED] wrote:
I am trying to make a link collector.
after opening the desired page, I want to get all the hyperlinks on it...
OK, this is quick and nasty, but you can add sanity/error checking etc
as you please, but it shows you the concept..
I am new to regex and broke my head on it the other day...in vain...
Can any one tell me a place to get a step by step tutorial on it or help me
out on how to work it out ?
I am trying to make a link collector.
after opening the desired page, I want to get all the hyperlinks on it...
Thank
Hello there,
i have to check if there's a dot in a string, and i need nothing but the
regex pattern for this... tryed a lot, but the dot itself means to matches
all.
can u help ?
regards
marian feiler
--
Internetservice Marketing Agentur
isurfin.net Marian Feiler
Altenessener Str. 99
i have to check if there's a dot in a string, and i need nothing but the
regex pattern for this... tryed a lot, but the dot itself means to matches
all.
you can read a little and not very clear introduction here:
http://nl.php.net/manual/nl/pcre.pattern.modifiers.php
and
Could someone show me how to use preg_replace to change this:
test OPTION VALUE=testtest/OPTION test
into:
anotherword OPTION VALUE=\test\test/OPTION anotherword
basically, I want to change a value only if it is not in an option
tag.
I also want to account for situations like :
test,
addslashes()
- Original Message -
From: Jim [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 11:26 AM
Subject: [PHP] Regex Help
Could someone show me how to use preg_replace to change this:
test OPTION VALUE=testtest/OPTION test
into:
anotherword OPTION
is to change 'test' into 'anotherword'
only if it is not within the option tag.
Thanks!
- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: Jim [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 12:42 PM
Subject: Re: [PHP] Regex Help
addslashes
, December 19, 2002 11:55 AM
Subject: Re: [PHP] Regex Help
I'm sorry, I accidentally left the slashes on my second example. My original
message should read:
Could someone show me how to use preg_replace to change this:
test OPTION VALUE=testtest/OPTION test
into:
anotherword OPTION VALUE
Subject: Re: [PHP] Regex Help
?php
$q = test OPTION VALUE=\test\test/OPTION test;
ereg((.*)(OPTION.*OPTION)(.*),$q,$ar);
$t = anotherword.$ar[2].anotherword;
print $t;
?
outputs:
anotherwordOPTION VALUE=testtest/OPTIONanotherword
--
PHP General Mailing List (http://www.php.net
]
To: [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 1:24 PM
Subject: Re: [PHP] Regex Help
Thanks for helping. Unfortunately, that doesn't quite accomplish the task
either. The other example for my first post would be mangled with that.
- Original Message -
From: Rick Emery [EMAIL
OPTION VALUE=testtest/OPTION anotherword
- Original Message -
From: Jim [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 12:25 PM
Subject: Re: [PHP] Regex Help
Whoops, sorry post aborted prematurely.
What I was going say say was that:
test, something OPTION VALUE
. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
-Original Message-
From: Jim [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 1:24 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Regex Help
Thanks
Hi-
I was wondering if someone could help me with a regex to test for a valid
domain name (foo.com).
Thanks in advance,
Max
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Troy May wrote:
How would take a regular non-formatted text link (http://www.link.com) and
turn it into ready to post HTML? (a
href=http://www.link.comhttp://www.link.com/a)
Darn, Outlook formats it, but you get the idea. It would just be typed out
normally.
Any ideas?
function MakeUrl
How would take a regular non-formatted text link (http://www.link.com) and
turn it into ready to post HTML? (a
href=http://www.link.comhttp://www.link.com/a)
Darn, Outlook formats it, but you get the idea. It would just be typed out
normally.
Any ideas?
--
PHP General Mailing List
Instead of splitting the string on chars that don't equal \w and ',
split it on chars that equal \s (or any other you need)
Gerard Samuel wrote:
Im trying to explode a string into an array of words using -
$title = preg_split('/[^\w\']/', $title, -1, PREG_SPLIT_NO_EMPTY );
It seems to work
Im trying to explode a string into an array of words using -
$title = preg_split('/[^\w\']/', $title, -1, PREG_SPLIT_NO_EMPTY );
It seems to work well with words like this and don't but it doens't
work with words with accents to it like
Guantánamo
Could my regex be expanded to handle
In my never-ending battle against swearing on my site, I'm trying to use
a regex that changes any word that ends with abc to xyz. I'm using:
$tofilter = This is a string containing the word 123abc.;
$tofilter= eregi_replace([^ ]abc,xyz,$tofilter);
But it returns 12xyz. It clearly picks up
Hello,
Leif K-Brooks [EMAIL PROTECTED] wrote:
[snip]
But that doesn't work at all. Any ideas on how to do this?
[/snip]
Would't it be easier (and faster) to use
http://www.php.net/manual/en/function.str-replace.php ?
- E
--
PHP General Mailing List (http://www.php.net/)
To
I need to do a few other things that require regex though, like making
either an a or an @ match (people love to get around filters by using
symbols instead of letters...).
@ Edwin wrote:
Hello,
Leif K-Brooks [EMAIL PROTECTED] wrote:
[snip]
But that doesn't work at all. Any ideas on how
Im trying to apply htmlspecialchars() to hrefs in a string.
Here is what I have.
?php
$str = 'hi bmy friend/b! br / this message uses html entities a
href=http://www.trini0.org;test/a!';
$str = preg_replace('/(a href=http:\/\/.*.*\/a)/',
htmlspecialchars($1), $str);
as part of a larger application we have a bit of code that processes whois to
determine domain name expiry dates. Most formats are easily parsed, but
Register.Com has thrown the little regex for a loop and I am unsure as to a
clean workaround.
Here is what we have;
...
To Match: Tue, Jul 29, 2003
$pregmatchstring=/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record
\sExp ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i;
You can change the last part of $pregmatchstring in:
Expiry\sDate)([\D\s]*|\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i;
You can feed
On Sat, Aug 03, 2002 at 05:03:36PM +0100, Phil Ewington wrote:
Hi,
I am am writing a function to color code and indent JavaScript source using
regular expressions and cannot seem to get back referencing working.
What you're using isn't back referencing, it's utilizing substrings.
Back
Hi,
I am am writing a function to color code and indent JavaScript source using
regular expressions and cannot seem to get back referencing working. The
pattern match is successful but the output is a single unrecognised
character (a square).
$string = eregi_replace((/?)(scr[^]*), «font
try
\\1
- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:03 PM
Subject: [PHP] RegEx (back referencing)
Hi,
I am am writing a function to color code and indent JavaScript source
using
regular expressions
- not perfect, but a start.
Danny.
- Original Message -
From: Phil Ewington [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Sent: Saturday, August 03, 2002 5:52 PM
Subject: RE: [PHP] RegEx (back referencing)
\\1 outputs nothing at all wrapped in font tags and closing tags \ wrapped
What's strange is that doing an ord($string) returns 171, which is a '1/2'
char. So why does PHP convert the pattern match??
-Original Message-
From: Phil Ewington [mailto:[EMAIL PROTECTED]]
Sent: 03 August 2002 17:04
To: PHP General
Subject: [PHP] RegEx (back referencing)
Hi
Danny,
It still doesn't work, could this be a problem in 4.0.4pl1 ??
-Original Message-
From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
Sent: 03 August 2002 18:11
To: [EMAIL PROTECTED]; PHP-General
Subject: Re: [PHP] RegEx (back referencing)
If you're trying to get scriptLots
PM
Subject: RE: [PHP] RegEx (back referencing)
Danny,
It still doesn't work, could this be a problem in 4.0.4pl1 ??
-Original Message-
From: Danny Shepherd [mailto:[EMAIL PROTECTED]]
Sent: 03 August 2002 18:11
To: [EMAIL PROTECTED]; PHP-General
Subject: Re: [PHP] RegEx
PROTECTED]
Sent: Saturday, August 03, 2002 8:54 PM
Subject: RE: [PHP] RegEx (back referencing)
Danny,
OK, the input string is the contents of a file, the idea is to output
color
coded and indented code in HTML. So searching for script and replace
with
font color=maroonscript/font, so
Does anyone have a regular expression that works to validate credit card
numbers?
Mike
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I'm using a regular expression (below) to check phone numbers. I'm getting
an error that I can't make sense of.
$regex = ^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$;
Output I'm getting =
Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28
Anyone know what this means? I
On Sun, Jul 28, 2002 at 04:02:32PM -0400, Mike Mannakee wrote:
Does anyone have a regular expression that works to validate credit card
numbers?
http://www.analysisandsolutions.com/code/ccvs-ph.htm
I just updated it to Version 4.3 LATE Friday night. So, anyone using
anything earlier than
other than each'ing an array and performing a regex match, is there an easier
way to parse through the values in an array for a value matching
*something*somethingelse*
thanks
Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
other than each'ing an array and performing a regex match, is there an easier
way to parse through the values in an array for a value matching
*something*somethingelse*
No, I don't believe so. But I'm sure you can set up something to use with
array_walk().
Chris
--
PHP General Mailing
Hi,
I try to refer to the '' character in a regex using preg_replace
function:
preg_replace(/(http:\/\/.\S+(?![\\]))/, a href=\$1\
target='ext'$1/a, http://testbr);
Ref to '' with '\' seems to work but not '' with '\'...
Any idea???
Thanks!
--
PHP General Mailing List
i have something like
$str = sometext sometext [emoticon01] sometext [emoticon23] sometext;
i would like to use regex to replace those codes into:
sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext
all numerics after the code emoticon consisted of exactly 2 digits; and
PROTECTED]
Sent: Monday, July 08, 2002 11:41 AM
Subject: [PHP] regex for emoticon codes
i have something like
$str = sometext sometext [emoticon01] sometext [emoticon23] sometext;
i would like to use regex to replace those codes into:
sometext sometext /images/emot/01.gif sometext /images/emot/23.gif
);
print $new_str;
Seems to work?
Rgds
John
- Original Message -
From: Roger Thomas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 11:41 AM
Subject: [PHP] regex for emoticon codes
i have something like
$str = sometext sometext [emoticon01
List,
How can I regex to compare the last three chars of a string to php?
/B
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
, July 02, 2002 2:49 PM
Subject: [PHP] RegEx question
List,
How can I regex to compare the last three chars of a string to php?
/B
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net
$string = 'somethingphp';
$pat = 'php$';
$hasphp = ereg($pat, $string);
Henning Sittler
www.inscriber.com
-Original Message-
From: David Busby [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 02, 2002 4:49 PM
To: php-general
Subject: [PHP] RegEx question
List,
How can I
501 - 600 of 733 matches
Mail list logo