Re: [PHP] Regex help (SOLVED)

2004-03-15 Thread Michal Migurski
Thanks to everyone who gave me examples, links and suggested alternatives like explode(), but personally I thought explode too was a regex..:-(. explode() is not, split() is. - michal migurski- contact info and pgp key: sf/ca

[PHP] Regex Help

2004-01-26 Thread karthikeyan
Sorry last time I forgot to put subject on my mail. So here I am putting appropriate subject and sending it. Hi All, Just wondering if somebody can help me with this small regex search. The information I wanted to capture is the one in the Square Bracket. i.e Date : 1/21/04, Race Type: 5-16,

[PHP] Regex help please

2004-01-11 Thread Shawn McKenzie
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

[PHP] RegEx -- help

2003-10-10 Thread Lists
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

Re: [PHP] RegEx -- help

2003-10-10 Thread Mohamed Lrhazi
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

[PHP] Regex help appreciated

2003-08-14 Thread David Pratt
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

Re: [PHP] Regex help appreciated

2003-08-14 Thread Mukul Sabharwal
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

[PHP] regex help?

2003-07-21 Thread John Herren
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

[PHP] regex help?

2003-07-21 Thread John Herren
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

Re: [PHP] regex help?

2003-07-21 Thread David Nicholson
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:

[PHP] Regex help needed

2003-07-16 Thread Sid
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

Re: [PHP] Regex help needed

2003-07-16 Thread Curt Zirzow
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

[PHP] Regex Help with - ?

2003-06-26 Thread Gerard Samuel
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

Re: [PHP] Regex Help

2003-02-11 Thread Ernest E Vogelsinger
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 ?

Re: [PHP] Regex Help

2003-02-11 Thread Kevin Waterson
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..

[PHP] Regex Help

2003-02-10 Thread Lord Loh.
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

[PHP] Regex Help

2002-12-19 Thread Jim
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,

Re: [PHP] Regex Help

2002-12-19 Thread Rick Emery
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

Re: [PHP] Regex Help

2002-12-19 Thread Jim
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

Re: [PHP] Regex Help

2002-12-19 Thread Rick Emery
, 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

Re: [PHP] Regex Help

2002-12-19 Thread Jim
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

Re: [PHP] Regex Help

2002-12-19 Thread Jim
] 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

Re: [PHP] Regex Help

2002-12-19 Thread Rick Emery
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

RE: [PHP] Regex Help

2002-12-19 Thread John W. Holmes
. 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

Re: [PHP] Regex Help

2002-10-30 Thread Marek Kilimajer
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

[PHP] Regex Help

2002-10-29 Thread Gerard Samuel
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

[PHP] regex help

2002-09-01 Thread Gerard Samuel
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);

[PHP] regex help

2002-05-26 Thread Jeff Field
This is not really specific to PHP (although the information might be useful for all that form validation we all do), and for that I apologize in advance (does anyone know of a regex mailing list?), but maybe someone here can help with the following: I find no good regex for checking valid

Re: [PHP] regex help

2002-05-26 Thread Miguel Cruz
I use this, but it's a preg rather than ereg pattern: '/([a-z0-9]+[a-z0-9\-]*\.)+[a-z0-9]+[a-z0-9\-]*[a-z0-9]+$/i' Two problems (which in practice are so slight that I've foregone my usual standards-analness to ignore them) 1) It will allow a domain name component (except the final one)

[PHP] Regex help

2001-08-22 Thread Stefen Lars
Hello all In the Apache config file, we have the following directive: SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1 FilesMatch .(gif|jpg) Order Allow,Deny Allow from env=local_ref /FilesMatch We use this to prevent people from directly linking to .gif and .jpg files. This

Re: [PHP] regex help

2001-07-17 Thread Lasse
[mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 12:43 AM To: [EMAIL PROTECTED] Subject: [PHP] regex help hi all, a little OT here, but need some quick help. I have a bunch of e-mails to convert into sql entries and I'm stuck here. I have: , John Doe, [EMAIL PROTECTED], ..

[PHP] regex help

2001-07-16 Thread Alvin Tan
hi all, a little OT here, but need some quick help. I have a bunch of e-mails to convert into sql entries and I'm stuck here. I have: , John Doe, [EMAIL PROTECTED], .. I just need to know what's the regex to switch around the name and e-mail address. TIA, @lvin -- PHP General

RE: [PHP] regex help

2001-07-16 Thread Jack Dempsey
What exactly are you trying to do? Switch around in what way? Jack -Original Message- From: Alvin Tan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 12:43 AM To: [EMAIL PROTECTED] Subject: [PHP] regex help hi all, a little OT here, but need some quick help. I have a bunch

[PHP] Regex Help

2001-07-13 Thread Sheridan Saint-Michel
I am trying to write a script that needs a list of all the images in an HTML file. I am trying this code if (eregi ((img.+src=)(.+)[\s],$buffer, $regs )) { echo $regs[2]BRBR; } The problem, however is that when it looks at IMG SRC=images/Logo.gif ALT=Only Child Club - The

RE: [PHP] Regex Help

2001-07-13 Thread Erick Calder
into the (). - e r i c k -Original Message- From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 9:04 AM To: [EMAIL PROTECTED] Subject:[PHP] Regex Help I am trying to write a script that needs a list of all the images in an HTML file. I am trying

Re: [PHP] regex help...again

2001-03-30 Thread Christian Reiniger
On Friday 30 March 2001 06:47, you wrote: Ok, i have a text file with lines that looks like this: 14```value```value2`value3 This would be fine, except...there are sometimes more than in other columns, so id like it to be 14``value``value2``value3 $new = preg_replace ('/`+/',

Re: [PHP] regex help...again

2001-03-30 Thread elias
So as you seem to be good with regexps, can you tell me how i can write a code that will search for next occurence in a string? where pattern is a regexp and a string is long and ofcourse there will be lots of pattern matchs in it...? thanks "Christian Reiniger" [EMAIL PROTECTED] wrote in

Re: [PHP] regex help...again

2001-03-30 Thread Christian Reiniger
On Saturday 31 March 2001 00:07, you wrote: So as you seem to be good with regexps, can you tell me how i can write a code that will search for next occurence in a string? where pattern is a regexp and a string is long and ofcourse there will be lots of pattern matchs in it...? What about

[PHP] regex help...again

2001-03-29 Thread David Balatero
Ok, i have a text file with lines that looks like this: 14```value```value2`value3 This would be fine, except...there are sometimes more than in other columns, so id like it to be 14``value``value2``value3 So I can explode() it into a mysql database. Can anyone offer a regexp for

Re: [PHP] regex help...again

2001-03-29 Thread elias
It's a lame way, but it works, I sure hope that someone can tell me how to do it in pure regexp. like how can i 'search for next occurence' in ereg or any regexp() in PHP - ? $str = "14```value```value2`value3``hehe!``hohoho"; while ( ereg("[^`]+", $str, $result) ) { $match =

[PHP] regex help

2001-02-27 Thread Jerry Lake
how do I select the first space after some alpha-numeric characters? I can ^\D\s to get the characters and the space, but how can I select the space only? Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online -

[PHP] regex help

2001-02-23 Thread John Vanderbeck
Hello, I need to take a string and remove everything from the first "" character to the end of the line. I'm pretty sure I could do this with an ereg_replace(), but I am horrible at regular expressions. Could anyone help me with this? - John Vandebreck - Admin, GameDesign -- PHP General

Re: [PHP] regex help

2001-02-23 Thread Christian Reiniger
On Friday 23 February 2001 19:33, John Vanderbeck wrote: I need to take a string and remove everything from the first "" character to the end of the line. I'm pretty sure I could do this with an ereg_replace(), but I am horrible at regular expressions. Could anyone help me with this?

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

<    1   2