Re: [PHP] regex problem

2004-07-01 Thread Josh Close
Why is it taking the char before the [^\r] also? -Josh On Thu, 1 Jul 2004 15:17:04 -0700, Justin Patrin [EMAIL PROTECTED] wrote: On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close [EMAIL PROTECTED] wrote: I'm trying to get a simple regex to work. Here is the test script I have.

Re: [PHP] regex problem

2004-07-01 Thread Curt Zirzow
* Thus wrote Justin Patrin: On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close [EMAIL PROTECTED] wrote: I'm trying to get a simple regex to work. Here is the test script I have. #!/usr/bin/php -q ? $string = hello\nworld\n; $string = preg_replace(/[^\r]\n/i,\r\n,$string); $string

Re: [PHP] Regex Help

2004-05-10 Thread Curt Zirzow
* Thus wrote hitek ([EMAIL PROTECTED]): Greetings list, I have been given a list of products, and I need some help building a regular expression to split the category from the sub category. Example: CamerasDigital_CannonXLRshot -Original entry in list Cameras Digital Cannon XLRshot

Re: [PHP] Regex Help

2004-05-10 Thread hitek
Curt, That's perfect. Works like a charm. Thanks, Keith At 03:54 PM 5/10/2004, Curt Zirzow wrote: * Thus wrote hitek ([EMAIL PROTECTED]): Greetings list, I have been given a list of products, and I need some help building a regular expression to split the category from the sub category.

Re: [PHP] Regex

2004-03-31 Thread Red Wingate
preg_match( #39-([0-9]{8})# , $source , $result ); Brent Clark wrote: Hi all does anyone know of a regex expression to get only the number number from after the Code 39 Kind Regards Brent Clark 1 barcodes found Code 39-10005215 This is the search1 barcodes found 2 barcodes found Code

Re: [PHP] Regex

2004-03-31 Thread Burhan Khalid
Brent Clark wrote: Hi all does anyone know of a regex expression to get only the number number from after the Code 39 Kind Regards Brent Clark 1 barcodes found Code 39-10005215 $barcodes = Code 39-10005216; $parts = explode(,$barcodes); echo Number is .$parts[1]; Might be faster. -- PHP

Re: [PHP] Regex

2004-03-31 Thread Red Wingate
Faster, but wrong. Take a look at his question and examples. Burhan Khalid wrote: Brent Clark wrote: Hi all does anyone know of a regex expression to get only the number number from after the Code 39 Kind Regards Brent Clark 1 barcodes found Code 39-10005215 $barcodes = Code 39-10005216;

Re: [PHP] Regex

2004-03-31 Thread John W. Holmes
From: Burhan Khalid [EMAIL PROTECTED] Brent Clark wrote: Hi all does anyone know of a regex expression to get only the number number from after the Code 39 Kind Regards Brent Clark 1 barcodes found Code 39-10005215 $barcodes = Code 39-10005216; $parts = explode(,$barcodes);

RE: [PHP] Regex

2004-03-31 Thread Daevid Vincent
Just thought I'd throw this amazing tool out there as I just discovered it too: http://www.weitz.de/regex-coach/ Windows and linux versions for free! -Original Message- From: Brent Clark [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 7:29 AM To: [EMAIL PROTECTED]

Re: [PHP] Regex help - PLease

2004-03-17 Thread Michal Migurski
Sorry I to should have added this this is what im going with so far preg_match(/\d100.*/); This will match a digit, followed by '100', followed by anything. Go with Rob's suggestion. - michal migurski- contact info and pgp key:

Re: [PHP] Regex help - PLease

2004-03-16 Thread Richard Davey
Hello Brent, Tuesday, March 16, 2004, 12:39:27 PM, you wrote: BC im in desperate need of help for a reg expression to ONLY allow 8 BC NUMBERS to start with 100 and may not have any other kind of BC letters or characters. Only numbers BC for example BC 10064893 It's not a reg exp, but it will

Re: [PHP] Regex help - PLease

2004-03-16 Thread Rob Ellis
On Tue, Mar 16, 2004 at 02:39:27PM +0200, Brent Clark wrote: Hi there im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to start with 100 and may not have any other kind of letters or characters. Only numbers for example 10064893 if

Re: [PHP] Regex help - PLease

2004-03-16 Thread Pablo
On 03/16/2004 6:57 AM, Rob Ellis [EMAIL PROTECTED] wrote: On Tue, Mar 16, 2004 at 02:39:27PM +0200, Brent Clark wrote: Hi there im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to start with 100 and may not have any other kind of letters or characters. Only

RE: [PHP] Regex help

2004-03-15 Thread Chris W. Parker
Ryan A mailto:[EMAIL PROTECTED] on Monday, March 15, 2004 9:07 AM said: I know this is pretty easy to do but I am horrorable at working with regular expressions and was wondering if anybody might take a min to help please. in that case you should get the regex coach (easy to find via

Re: [PHP] Regex help

2004-03-15 Thread Jason Wong
On Tuesday 16 March 2004 01:06, Ryan A wrote: I know this is pretty easy to do but I am horrorable at working with regular expressions and was wondering if anybody might take a min to help please. I will have a variable: $the_extention which will have a value like:

Re: [PHP] Regex help

2004-03-15 Thread Michal Migurski
I will have a variable: $the_extention which will have a value like: 98797-234234--2c-something-2c How do I take out the part which will always start with --2c and will always end with -2c You could use preg_replaces, like so: $result = preg_replace('/--2c.+-c/', '', $the_extention);

Re: [PHP] Regex help

2004-03-15 Thread Eric Gorr
At 6:06 PM +0100 3/15/04, Ryan A wrote: I know this is pretty easy to do but I am horrorable at working with regular expressions and was wondering if anybody might take a min to help please. I will have a variable: $the_extention which will have a value like:98797-234234--2c-something-2c How

RE: [PHP] Regex help

2004-03-15 Thread Ryan A
Hey, Thanks guys. I did search on google first for a tutorial, problem is with something as widely used as regular expressions there are LOTS of results...I felt it would be better to ask if anyone has a favourite.. ie: if you learnt it off the web and not via the manual. The last time I had

Re: [PHP] Regex help

2004-03-15 Thread trlists
On 15 Mar 2004 Eric Gorr wrote: which will have a value like:98797-234234--2c-something-2c How do I take out the part which will always start with --2c and will always end with -2c I'd be interested in the answer to this question as well. Seems like it should be easy. It is easy.

Re: [PHP] Regex help (SOLVED)

2004-03-15 Thread Ryan A
Hey Guys, Solved this, took your advise and avoided regex as its an overkill. Case you're interested: $th_var=98797-234234--2c-something-2c; $piece = explode(--2, $th_var); echo $piece[0]; (and if i want to use the second part... $piece[1] ) Thanks to everyone who gave me examples, links and

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

Re: [PHP] regex to change ' to ?

2004-03-04 Thread Richard Davey
Hello Adam, Thursday, March 4, 2004, 3:36:06 PM, you wrote: AW What would be the PHP expression to change any and all ' to ? in a AW variable? AW I want to change any and all ' in $_POST[data] to ? $output_array = str_replace(', ?, $_POST); Use this instead of a reg exp for such a simple

Re: [PHP] regex to change ' to ?

2004-03-04 Thread Adam Williams
Thank you, that works great! On Thu, 4 Mar 2004, Richard Davey wrote: Hello Adam, Thursday, March 4, 2004, 3:36:06 PM, you wrote: AW What would be the PHP expression to change any and all ' to ? in a AW variable? AW I want to change any and all ' in $_POST[data] to ? $output_array

Re: [PHP] Regex to grab a Windows Path from a String...

2003-12-17 Thread Marek Kilimajer
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

Re: [PHP] Regex to grab a Windows Path from a String...

2003-12-17 Thread sumbry
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[ ]*=[

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

RE: [PHP] regex drive me crazy

2003-10-02 Thread Ford, Mike [LSS]
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

RE: [PHP] regex drive me crazy

2003-10-02 Thread Ford, Mike [LSS]
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

Re: [PHP] regex/preg_replace() difficulty

2003-10-01 Thread Marek Kilimajer
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

Re: [PHP] regex/preg_replace() difficulty

2003-10-01 Thread CPT John W. Holmes
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

RE: [PHP] regex drive me crazy

2003-10-01 Thread Chris W. Parker
[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

Re: [PHP] regex drive me crazy

2003-10-01 Thread jonas_weber
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

Re: [PHP] regex drive me crazy

2003-10-01 Thread Curt Zirzow
* 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

RE: [PHP] regex problem

2003-08-15 Thread Ford, Mike [LSS]
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

Re: [PHP] regex causing headache ;-(

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

Re: [PHP] regex causing headache ;-(

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

Re: [PHP] Regex help appreciated

2003-08-14 Thread Mukul Sabharwal
Firstly, If your text spans more than one line you should use \n, rather than just doing something like : a href=\ hello\...(.*)/a because that will mess up, depending on what text editor you use, eg. notepad will put \r\n, but it should only be \n. Though I'm not sure about it. So the best

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:

Re: [PHP] Regex and variable usage

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

Re: [PHP] Regex and variable usage

2003-07-16 Thread Gerard Samuel
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 =

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

Re: [PHP] Regex and variable usage

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

Re: [PHP] REGEX Question

2003-06-18 Thread Don Read
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:

Re: [PHP] REGEX Question

2003-06-18 Thread SLanger
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 !--

Re: [PHP] REGEX Question

2003-06-17 Thread Marek Kilimajer
. 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

Re: [PHP] regex problem

2003-06-01 Thread Jim Lucas
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 anything that is not a number or one of the other special chars that are in

Re: [PHP] regex problem

2003-06-01 Thread Daniel J. Rychlik
: 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

Re: [PHP] regex

2003-03-22 Thread Leif K-Brooks
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

Re: [PHP] regex

2003-03-22 Thread Nate Sanden
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);

Re: [PHP] regex

2003-03-22 Thread Nate
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);

Re: [PHP] regex

2003-03-22 Thread Leif K-Brooks
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

Re: [PHP] regex

2003-03-22 Thread Nate
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

RE: [PHP] regex problem

2003-03-16 Thread John W. Holmes
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

Re: [PHP] regex problem

2003-03-13 Thread CPT John W. Holmes
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

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..

Re: [PHP] regex

2003-02-07 Thread Chris Hayes
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

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 question

2002-12-13 Thread Sean Burlington
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

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

Re: [PHP] Regex question...

2002-10-28 Thread @ Edwin
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

Re: [PHP] Regex question...

2002-10-28 Thread Leif K-Brooks
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

Re: [PHP] regex match problem

2002-08-14 Thread Bas Jobsen
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

Re: [PHP] RegEx (back referencing)

2002-08-04 Thread Analysis Solutions
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

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
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

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
- 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

RE: [PHP] RegEx (back referencing)

2002-08-03 Thread Phil Ewington
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,

RE: [PHP] RegEx (back referencing)

2002-08-03 Thread Phil Ewington
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

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
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

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
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

Re: [PHP] REGEX for credit card number

2002-07-28 Thread Analysis Solutions
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

Re: [PHP] regex in_array or array_search

2002-07-17 Thread Chris Boget
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

Re: [PHP] regex for emoticon codes

2002-07-08 Thread John Legg
Hi Roger Try this: $str = sometext sometext [emoticon01] sometext [emoticon23] sometext; $new_str = preg_replace(/\[emoticon(\d\d)\]/, /image/emot/\\1.gif, $str); print $new_str; Seems to work? Rgds John - Original Message - From: Roger Thomas [EMAIL PROTECTED] To: [EMAIL

Re: [PHP] regex for emoticon codes

2002-07-08 Thread Roger Thomas
yeeaHAH ! great. Thanks John. think i'll never regret joining the list. -- roger --- John Legg [EMAIL PROTECTED] wrote: Hi Roger Try this: $str = sometext sometext [emoticon01] sometext [emoticon23] sometext; $new_str = preg_replace(/\[emoticon(\d\d)\]/, /image/emot/\\1.gif, $str);

Re: [PHP] RegEx question

2002-07-02 Thread Kevin Stone
Actually for a job like this look to substr() to extract the last three chars as a string and compare them in an if() statment. http://www.php.net/manual/en/function.substr.php -Kevin - Original Message - From: David Busby [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent:

RE: [PHP] RegEx question

2002-07-02 Thread Henning Sittler
$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

Re: [PHP] RegEx question

2002-07-02 Thread Gurhan Ozen
eregi(php$, $stringtobecompared); See: http://www.php.net/manual/en/ref.regex.php Gurhan - Original Message - From: David Busby [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Tuesday, July 02, 2002 4:49 PM Subject: [PHP] RegEx question List, How can I regex to compare

Re: [PHP] regex

2002-06-11 Thread Gerard Samuel
Well Ive gotten (.*) and ([a-z]*[0-9]*_*-*) to work thus far as the first group. I would like to avoid option 1, and option 2 doesn't seem right Gerard Samuel wrote: Im expecting a string like foo.png. Im trying to replace 'foo' with another value that I have. Im trying this - $file

Re: [PHP] regex

2002-06-11 Thread Jim lucas
$file = preg_replace('/^([a-z0-9\-\_]*).([a-z]{3,4})$/i', $new_file . .$2, $_FILES['upload']['name']); Maybe this? Jim Lucas - Original Message - From: Gerard Samuel [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, June 11, 2002 3:11 PM Subject: [PHP] regex Im expecting a

Re: [PHP] RegEx problems...

2002-06-03 Thread Analysis Solutions
On Mon, Jun 03, 2002 at 11:15:15AM -0600, Jas wrote: In order to view the contents of the file in the text area I had to setup a eregi_replace(,a) string. 's are not legal in HTML. You need to escape them. When pulling stuff out of the file, use htmlspecialchars() before displaying the

RE: [PHP] Regex Assistance

2002-05-28 Thread Scott Hurring
This should work for most cases: function strip_key($key, $string) { $string = preg_replace(/(|\?)($key=(\w+)?)(?)/, '$1', $string); return preg_replace('/(\?|)$/', '', $string); } print strip_key(list, yadda?bo=ralist=XXXtwo=three); print strip_key(list, yadda?bo=ralist=two=three); print

RE: [PHP] Regex Assistance

2002-05-27 Thread Martin Towell
this is what I use to get rid of line from the url $qs = ereg_replace($, , ereg_replace(line=[^]*?, , $QUERY_STRING)); HTH MArtin -Original Message- From: Scott Reismanis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP] Regex

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)

RE: [PHP] regex: string begins with NEITER http NOR cid NOR mailto

2002-05-19 Thread Ray Hunter
Show some code... Thanks, Ray BigDog Hunter -Original Message- From: kras [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 19, 2002 9:53 AM To: [EMAIL PROTECTED] Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto Hello! I have got a big problem: I have html

Re: [PHP] regex: string begins with NEITER http NOR cid NOR mailto

2002-05-19 Thread kras
There you are $html = preg_replace ('href=(\|)(?!mailto)([.]*?[^\]*?)(\| )'si, href=\.$bejsnejm.\\2\, $html); $html = preg_replace ('(src|background|href)=(\|)(?!http)([.]*?[^\]*?)(\| )'si, \\1=\.$bejsnejm./\\3\, $html); of course it fails. kras Show some code... Thanks, Ray

Re: [PHP] regex (preg_replace)

2002-05-18 Thread Gerard Samuel
I figured it out. Change the last line to echo htmlspecialchars($b); and you'll get the proper output. Gerard Samuel wrote: Im trying to get a final output to be 'item' but Im unable to get working. Could someone point me where Im going wrong. Thanks ?php $a = 'item

Re: [PHP] RegEx and ?

2002-04-24 Thread Marius Ursache
Boaz Yahav a écrit : When i try to use preg_match on strings that have ? inside them it seems to not work. Any ideas how to bypass this? thanks berber -- Marius Ursache (3563 || 3494) \|/ \|/ '/ ,. \`

Re: [PHP] RegEx and ?

2002-04-24 Thread Marius Ursache
use \? instead of ? Boaz Yahav a écrit : When i try to use preg_match on strings that have ? inside them it seems to not work. Any ideas how to bypass this? thanks berber -- Marius Ursache (3563 || 3494) \|/ \|/ '/ ,. \`

RE: [PHP] Regex

2002-04-22 Thread Darren Gamble
Good day, Just off the top of my head, try: /.+\@.*([^\.]*\.[^\.]*)$/ Might not have the exact syntax, but, you get the idea. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948

Re: [PHP] Regex

2002-04-22 Thread Miguel Cruz
On Mon, 22 Apr 2002, James Taylor wrote: I'm trying to come up with a regular expression that will match the TL and Second Level domain names in someone's email address ONLY. Whatever you're planning on doing with that, I hope you're ready for addresses that end with .ac.uk and so on; trying

RE: [PHP] Regex Form Filter Help

2002-03-27 Thread Demitrious S. Kelly
Why not just limit it to one br? ?php $string=blahbrbrbrbrbrbrbrbrbrstuff; while ( stristr($string, 'brbr') ) { $string=str_replace('brbr', 'br', $string); } echo $string; ? something like that would wok well enough... -Original Message-

RE: [PHP] regex expession problems

2002-03-27 Thread Martin Towell
I don't have that much experience with preg* functions but if that's exactly how you've got it in your code, shouldn't there be no spaces?? that is: preg_match(/http:\/\/ | [[:space:]]/i,$valToEval); * * \-\both of these should be removed ?

Re: [PHP] regex

2002-03-27 Thread Matt Moreton
preg syntax is different to ereg (which you are using). You also need to provide an output variable. This would work: preg_match( /[0-9]+/, $input, $output ); -- Matt Carl E Shmidt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Now I'm looking to find 1 or

RE: [PHP] regex

2002-03-02 Thread Boaz Yahav
Maybe this can help : pick up an array of variables from a query string such as: http://www.archipro.com/test.php?state=ABstate=BC http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=3265 Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take

<    1   2   3   4   5   6   >