RE: [PHP] REGEX prob

2001-02-18 Thread ..s.c.o.t.t..
( !($f = fopen('test.txt', 'w')) ) { die("Cannot write file"); } else { fwrite($f, $html); fclose($f); } return 1; } ? -Original Message- From: n e t b r a i n [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 17, 2001 12:49 To: [EMAIL PROTECTED] Subject:

Re: [PHP] REGEX prob

2001-02-18 Thread Christian Reiniger
On Sunday 18 February 2001 19:54, n e t b r a i n wrote: function change_sess($html_code){ if(eregi("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}",$html_code)){ str_replace("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}","?=append_ur l() ;?", $html_code); str_replace doesn't know about regular

Re: [PHP] REGEX prob

2001-02-18 Thread n e t b r a i n
Hi Christian, $html_code = eregi_replace (..., $html_code); arghhh ... I'm so stupid !! Yes, u're right ... really, many thanks max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the

[PHP] REGEX prob

2001-02-17 Thread n e t b r a i n
Hi all, I'm trying to match a particular piece of string in a big string using a regex in order to change it whith another value ... I mean: eg: $html="a href=link.htm?flag=982420537PHPSESSID=2c86b460d360b13c3ef08b8a46b9cafcLnk /a"; function change_sess($html_code){

Re: [PHP] REGEX prob

2001-02-17 Thread Christian Reiniger
On Saturday 17 February 2001 21:49, n e t b r a i n wrote: function change_sess($html_code){ if(eregi("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}",$html_code)){ str_replace("flag=[0-9]{9}PHPSESSID=[[:alnum:]]{32}","?=append_url() ;?", $html_code); str_replace doesn't know about regular

[PHP] regex

2001-02-15 Thread Jerry Lake
is there a way I can make a regex to add a comma to the beginning of every line of a comma delimited file ? Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -- PHP General Mailing List

RE: [PHP] Regex help needed...

2001-02-13 Thread PHPBeginner.com
r PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jesse Swensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 13, 2001 4:39 AM To: PHPBeginner.com Subject: Re: [PHP] Regex help needed... Thank you for your suggest, but I don't

[PHP] Regex help needed...

2001-02-12 Thread Jesse Swensen
This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is spaces in between words, leave them alone. Suggestions? -- Jesse Swensen [EMAIL PROTECTED] -- PHP General Mailing List

Re: [PHP] Regex help needed...

2001-02-12 Thread Jason Stechschulte
On Mon, Feb 12, 2001 at 12:15:04PM -0500, Jesse Swensen wrote: This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is spaces in between words, leave them alone. $fix = ereg_replace("(^ )|(

RE: [PHP] Regex help needed...

2001-02-12 Thread PHPBeginner.com
PROTECTED] Subject: [PHP] Regex help needed... This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is spaces in between words, leave them alone. Suggestions? -- Jesse Swensen [EMAIL PROTECTED

Re: [PHP] Regex help needed...

2001-02-12 Thread Jesse Swensen
on 2/12/01 1:01 PM, Jason Stechschulte at [EMAIL PROTECTED] wrote: On Mon, Feb 12, 2001 at 12:15:04PM -0500, Jesse Swensen wrote: This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is

Re: [PHP] Regex help needed...

2001-02-12 Thread Jason Stechschulte
This is very close. If the string, " Testing ", had multiple spaces, but I wanted to convert each space to a "_", then what? I tried: There may be a better way, but here is a lengthy one that works. $checkme = " this is it "; if(ereg("^( )+", $checkme,

Re: [PHP] Regex help needed...

2001-02-12 Thread Jesse Swensen
on 2/12/01 4:30 PM, Christian Reiniger at [EMAIL PROTECTED] wrote: On Monday 12 February 2001 21:08, Jesse Swensen wrote: This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is spaces in

[PHP] regex : Extracting parts of a string :-???

2001-02-11 Thread akio
Hello everyone, I have a string like $thestring = "\"Hello everyone\" bye"; What I want to extract is: Hello everyone. Instead I get: bye. I use this command ereg("([^\"\"]*)$",$thestring,$regs) and echo $regs[1]. How can I extract what's within double quotes? TIA Regards -- PHP

Re: [PHP] regex : Extracting parts of a string :-???

2001-02-11 Thread Christian Reiniger
On Sunday 11 February 2001 17:21, akio wrote: $thestring = "\"Hello everyone\" bye"; What I want to extract is: Hello everyone. Instead I get: bye. I use this command ereg("([^\"\"]*)$",$thestring,$regs) and echo $regs[1]. How can I extract what's within double quotes? Hmm, I only

[PHP] Regex Matching

2001-02-08 Thread Andrew Rush
in Perl, i do thusly: $adtext = "This is a {test} john.smith\@mail.mainetoday.com"; $email = $1 if($adtext=~/(\{.*\})/); print "email = $email\n\n"; and i get back "email = "test". i then do thusly in PHP: $f=fopen($test_name, "r");

[PHP] RegEx and URLs

2001-01-31 Thread Joe Sheble (Wizaerd)
Either I missed the answer on the mailing list, or it was accidentally skipped, so I'll re-ask... I have a bit of text ( a TEXT field in mySQL ) and there may or may not be URLs in this text. (These URLs are defined as anything starting with http://, mailto:, or www.). Some of these URLs

[PHP] RegEx and URLs

2001-01-30 Thread Joe Sheble (Wizaerd)
I have some text that may or may not contain valid URLs (anything starting with an http:// or a mailto:). Some of these URLs may or may not be contained within a valid A HREF tag. Could somebody help me out with a regex that would find all the URLs that are not already contained in an A HREF

[PHP] RegEx and URLs

2001-01-30 Thread Joe Sheble (Wizaerd)
I have some text that may or may not contain valid URLs (anything starting with an http:// or a mailto:). Some of these URLs may or may not be contained within a valid A HREF tag. Could somebody help me out with a regex that would find all the URLs that are not already contained in an A HREF

Re: [PHP] regex with non-ascii characters

2001-01-30 Thread Jeff Warrington
In article 059301c08981$7859a020$[EMAIL PROTECTED], "Remco Chang" [EMAIL PROTECTED] wrote: You need to find the ASCII codes for these characters and include them in the range of acceptable chars in the ereg. something like: [\xc0-\xff] where this represents a range of ASCII codes in octal

[PHP] regex with non-ascii characters

2001-01-29 Thread Remco Chang
hi, just a quick question... i can't seem to have ereg() work with non-ascii characters such as the character ''. is this something that i can work around? remco chang www.bountyquest.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP] REGEX for tag attributes?

2001-01-17 Thread Thomas Angst
Howdy, I need to divide several attributes of a tag. div key1=val1 key2 = val2 key3='val3' key4 = "val4" how can I do this without too many time lost? Is it possible to do this with a regular expression? Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

RE: [PHP] REGEX for tag attributes?

2001-01-17 Thread Robert Collins
ho $match_result."BR"; } ? Robert W. Collins Web Developer II Insight / TC Computers www.insight.com www.tccomputers.com -Original Message- From: Thomas Angst [mailto:[EMAIL PROTECTED]] Sent: Monday, January 15, 2001 5:47 AM To: [EMAIL PROTECTED] Subject: [PHP] REGEX for tag attribut

[PHP] Regex for telephone number

2001-01-15 Thread Vikram Vaswani
Hi! Can someone help me out with a regex to validate a phone number? Thanks Vikram -- 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 administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] Regex for telephone number

2001-01-15 Thread Angus Mann
At 17:55 15/01/01 +0500, Vikram Vaswani wrote: Hi! Can someone help me out with a regex to validate a phone number? We'd need to know what format of telephone numbers you're looking to validate, first. Angus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

RE: [PHP] Regex for telephone number

2001-01-15 Thread Spallek, Heiko
Hi! Can someone help me out with a regex to validate a phone number? Read the examples at: http://www.php.net/manual/en/function.ereg-replace.php Der Heiko Buchtipp: http://www.aufbruch.com/ Heiko und Gisela Spallek: Aufbruch ins Land der unbegrenzten Moeglichkeiten. Studieren, Arbeiten und

Re: [PHP] Regex for telephone number

2001-01-15 Thread Alex Black
anges are afoot! _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 From: [EMAIL PROTECTED] (Vikram Vaswani) Newsgroups: php.gen

[PHP] REGEX

2001-01-14 Thread Romulo Roberto Pereira
Hey people! What is wrong with this code? $buffer = split("([0-9] --)",$pagedata); $x = count ($buffer); echo $x; for ($i=0;$i$x;$i++) { ereg("([0-9] --)", $buffer[$i], $text); ereg_replace (" --","", $text[1]); echo $text[1]; } Since $pagedata has 8 appearences of the REGEX I am

Re: [PHP] regex

2001-01-12 Thread Cynic
yes At 23:54 12.1. 2001, Jerry Lake wrote the following: -- is it possible with regex to change one or more text characters followed by a space into the same characters followed by a tab? Jerry Lake -- PHP General Mailing List

Re: [PHP] regex

2001-01-12 Thread Steve Edberg
At 02:54 PM 1/12/01 , Jerry Lake wrote: is it possible with regex to change one or more text characters followed by a space into the same characters followed by a tab? Jerry Lake For example - $NewString = ereg_replace("([[:alpha:]]+) ", "\\1".chr(9), $String); This will convert a

RE: [PHP] regex

2001-01-12 Thread Jerry Lake
3500 records and I'd hate to have to do it by hand any ideas? Jerry Lake- [EMAIL PROTECTED] -Original Message- From: Cynic [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 3:25 PM To: Jerry Lake; [EMAIL PROTECTED] Subject: RE: [PHP] regex depends. is the set of strings

RE: [PHP] regex

2001-01-12 Thread Jerry Lake
dds the comma after every word that is followed by one space and not just the first occurance Jerry Lake -Original Message- From: Cynic [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 3:41 PM To: Jerry Lake; [EMAIL PROTECTED] Subject: RE: [PHP] regex looks like you need to find all t

RE: [PHP] regex

2001-01-12 Thread Cynic
an extent, except that it adds the comma after every word that is followed by one space and not just the first occurance Jerry Lake -Original Message- From: Cynic [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 3:41 PM To: Jerry Lake; [EMAIL PROTECTED] Subject: RE: [PHP]

<    3   4   5   6   7   8