[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 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). Basically my users are allowed to specify

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[ ]*=[

[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

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

[PHP] regex/preg_replace() difficulty

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

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

[PHP] regex drive me crazy

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

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

[PHP] regex replace href-content

2003-08-24 Thread Christoph Gassmann
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

[PHP] regex problem

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

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

[PHP] regex causing headache ;-(

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

[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

[PHP] Regex and variable usage

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

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

[PHP] Regex nightmare:(

2003-07-09 Thread Tim Steele
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',

[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

[PHP] regex - delimiter problem

2003-06-19 Thread Armand Turpel
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

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

[PHP] REGEX Question

2003-06-17 Thread Ron Dyck
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,

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

[PHP] Regex for Browser Versions

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

[PHP] regex: line breaks to br w/exclusion

2003-06-05 Thread Andrew Warner
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:

[PHP] regex problem

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

Re: [PHP] regex problem

2003-06-01 Thread Jim Lucas
] 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

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

[PHP] regex

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

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

[PHP] regex problem

2003-03-13 Thread Simon De Deyne
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

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

[PHP] RegEx for a URL?

2003-03-06 Thread Jason Murray
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

[PHP] regex makes my head hurt

2003-03-04 Thread Kris Jones
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

[PHP] regex question?

2003-02-23 Thread Shawn McKenzie
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

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

2003-02-07 Thread Marian Feiler
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

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

[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

[PHP] regex for fqdn test

2002-12-16 Thread Max Clark
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

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

[PHP] Regex question

2002-12-12 Thread Troy May
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

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

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

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

[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 match problem

2002-08-14 Thread Dave [Hawk-Systems]
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; ...

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

[PHP] RegEx (back referencing)

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

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

[PHP] REGEX for credit card number

2002-07-28 Thread Mike Mannakee
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

[PHP] REGEX for phone #

2002-07-28 Thread Mike Mannakee
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

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

[PHP] regex in_array or array_search

2002-07-17 Thread Dave [Hawk-Systems]
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

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

[PHP] [REGEX] Regex ref to '' character problem (fwd)

2002-07-11 Thread Benjamin Plaquevent
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

[PHP] regex for emoticon codes

2002-07-08 Thread Roger Thomas
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

Re: [PHP] regex for emoticon codes

2002-07-08 Thread John Legg
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

Re: [PHP] regex for emoticon codes

2002-07-08 Thread Roger Thomas
); 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

[PHP] RegEx question

2002-07-02 Thread David Busby
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

Re: [PHP] RegEx question

2002-07-02 Thread Kevin Stone
, 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

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

<    1   2   3   4   5   6   7   8   >