[PHP] Re: preg_match()

2009-09-09 Thread Shawn McKenzie
Jan Reiter wrote: > Good Afternoon. > > > > This shouldn't be too complicated, but I can't come up with a solution for > the problem right now. It's about RegEx in PHP (5.2) > > > > Is there a way to capture ALL sub elements of an expression like > preg_match('@a(?[0-9])*b@' ,"a2345678b" ,

[PHP] Re: preg_match too greedy

2009-07-29 Thread Clancy
On Wed, 29 Jul 2009 13:42:23 -0400, p...@logi.ca (b) wrote: >I'm trying to figure out how to test if a string matches *exactly* >another string, using a regexp pattern. If this is REALLY what you want to do, what is wrong with strcmp? -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] Re: preg_match and dates

2009-03-02 Thread Michael A. Peters
Peter Ford wrote: Michael A. Peters wrote: I have absolutely no control over the source file. The source file is an xml file (er, sort of, it doesn't follow any particular DTD) and has a tag called VERBATIM_DATE in each record - looks to be required in their output as every record so far has it

[PHP] Re: preg_match and dates

2009-03-02 Thread Peter Ford
Michael A. Peters wrote: > I have absolutely no control over the source file. > > The source file is an xml file (er, sort of, it doesn't follow any > particular DTD) and has a tag called VERBATIM_DATE in each record - > looks to be required in their output as every record so far has it, but > w/o

Re: [PHP] Re: preg_match question...

2009-02-06 Thread Frank Stanovcak
"Shawn McKenzie" wrote in message news:e1.67.59347.e494c...@pb1.pair.com... > bruce wrote: >> hmmm... >> >> tried your preg__match/regex... >> >> i get: >> 0 - 1145 total >> 1 - 1145 >> 2 - l >> >> i would have thought that the 2nd array item should have had "total"... >> > > Probably want this:

Re: [PHP] Re: preg_match question...

2009-02-06 Thread Alpár Török
2009/2/6 Shawn McKenzie > bruce wrote: > > hmmm... > > > > tried your preg__match/regex... > > > > i get: > > 0 - 1145 total > > 1 - 1145 > > 2 - l > > > > i would have thought that the 2nd array item should have had "total"... > > > > Probably want this: '#(\d+)(.+)#' That's it sorry. Take a lo

Re: [PHP] Re: preg_match question...

2009-02-06 Thread Shawn McKenzie
bruce wrote: > hmmm... > > tried your preg__match/regex... > > i get: > 0 - 1145 total > 1 - 1145 > 2 - l > > i would have thought that the 2nd array item should have had "total"... > Probably want this: '#(\d+)(.+)#' -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (ht

RE: [PHP] Re: preg_match question...

2009-02-06 Thread bruce
hp-general@lists.php.net Subject: [PHP] Re: preg_match question... ""bruce"" wrote in message news:234801c98863$88f27260$0301a...@tmesa.com... > hi... > > trying to figure out the best approach to using preg_match to extract the > number from the follwing typ

[PHP] Re: preg_match question...

2009-02-06 Thread Frank Stanovcak
""bruce"" wrote in message news:234801c98863$88f27260$0301a...@tmesa.com... > hi... > > trying to figure out the best approach to using preg_match to extract the > number from the follwing type of line... > > " 131646 sometext follows.." > > basically, i want to extract the number, without the t

Re: [PHP] Re: preg_match() returns false but no documentation why

2007-05-30 Thread Paul Novitski
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote: The op will need to use something other than forward slashes. At 5/30/2007 03:26 PM, Jared Farrish wrote: You mean the delimiters (a la Richard's suggestion about using '|')? Hi Jared, If the pattern delimiter character appears in the pat

[PHP] Re: preg_match() returns false but no documentation why

2007-05-30 Thread Jared Farrish
On 5/30/07, Jim Lucas <[EMAIL PROTECTED]> wrote: The op will need to use something other than forward slashes. You mean the delimiters (a la Richard's suggestion about using '|')? so, this is going to match: ldap://testing123.com TRUE ldap://www.testing-123.com FALSE ldap://t

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Jonesy
On Fri, 1 Dec 2006, Kevin Murphy wrote: > On Nov 30, 2006, at 7:50 PM, Jonesy wrote: >> On Thu, 30 Nov 2006 14:16:16 -0800, Kevin Murphy wrote: >>> >>> I have some text that comes out of a database all in uppercase (old >>> IBM Mainframe that only supports uppercase characters). >> >> I see via oth

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Kevin Murphy
On Nov 30, 2006, at 7:50 PM, Jonesy wrote: On Thu, 30 Nov 2006 14:16:16 -0800, Kevin Murphy wrote: I have some text that comes out of a database all in uppercase (old IBM Mainframe that only supports uppercase characters). I see via other followups that you have your kludge working. *But*

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Dave Goodchild
In that case you could use the /e trailing option to use strtolower on the subpattern.

[PHP] Re: Preg_match - Find URL and convert to lower case

2006-11-30 Thread Jonesy
On Thu, 30 Nov 2006 14:16:16 -0800, Kevin Murphy wrote: > > I have some text that comes out of a database all in uppercase (old > IBM Mainframe that only supports uppercase characters). I see via other followups that you have your kludge working. *But* , What do you mean by "old IBM Mainframe

[PHP] Re: preg_match problem

2006-08-21 Thread Alex Turner
Off the top of my head: /form[1-6]\.php/ AJ www.deployview.com [EMAIL PROTECTED] wrote: hi. I have to check if the script file belongs to any ov form1.php to form6.php files. Need something like: preg_match('/form*.php/', $_SERVER['PHP_SELF']) wher * kan be any number between 1 and 6. Thank

[PHP] Re: preg_match

2006-08-10 Thread Al
Jon wrote: preg_match_all("/Charges \s\s+ $total x (.+) /siU", $single, $from_invoice); The text has "Charges" then a variable amount of spaces a previously picked decimal number" x " (and the data I want)" " is this correct or am I missing something? It seems to work sometimes and not others

[PHP] Re: Preg_match() regex

2006-04-21 Thread Rafael
As Joe implied with his link, the preg_* family is called PCRE (Perl Compatible Regular Expression), and that's because they accept a Perl-style regexp as a string, i.e. '/foo-foo/i' would do it. Jeff wrote: Regex pattern question here. I need to match on "Foo-F00", "Foo-foo", "foo-Foo". I

[PHP] Re: preg_match question

2004-08-18 Thread Chris Jenkinson
Nicklas Bondesson wrote: How do I find an exact match of a string with preg_match? Example: String1: www.test.com/ String2: www.test.com/somepage.php?param1=true How do you write the regexp to only return String1 and not String2 when you match against "www.test.com" ?? You should use the ^ and $ c

[PHP] Re: preg_match and regular expression

2003-12-08 Thread Justin Patrin
Fred wrote: Hi I have problems with a regular expression. I have a html file like this: Hello somthing And i want to use preg_match to get a list of all the tags in the file: result: $list[0] = Hello $list[1] = somthing I have tryed this: preg_match('/.*(\.*\<\/div\>).*/', $conte

[PHP] Re: preg_match

2003-08-02 Thread Michael Temeschinko
Lee Doolan wrote: "Michael" == Michael Temeschinko <[EMAIL PROTECTED]> writes: Michael> Hello, Michael> I would like to split a String containing ingredience with additional Michael> assigned footnotes... Michael> my problem I only get the first ingredience ($zutat at line 32 has

[PHP] Re: preg_match

2003-08-02 Thread Lee Doolan
> "Michael" == Michael Temeschinko <[EMAIL PROTECTED]> writes: Michael> Hello, Michael> I would like to split a String containing ingredience with additional Michael> assigned footnotes... Michael> my problem I only get the first ingredience ($zutat at line 32 has Michael>

RE: [PHP] Re: preg_match

2003-06-20 Thread Aaron Axelsen
ECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com - -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 4:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: preg_match preg_matchtry wi

[PHP] Re: preg_match

2003-06-20 Thread sven
preg_matchtry without backslashes. $pattern = "/$search/i"; if (preg_match ($pattern, $date[$i])) { echo "$date[$i]"; } you don't need the .*? in your regex (either * or ? multiplier) as preg_match searches for any occurance (not from begin ^ or to end $). ciao SVEN "Aaron Axelsen" <[EMAI

[PHP] Re: preg_match question: locating unmatched HTML tags

2003-02-22 Thread php
you could consider configuring a prebuild html editor (just WYSIWYG) without any problems of users having to write code at all check out: http://www.interactivetools.com/products/htmlarea/ "Andy Crain" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > My apologies in advance if this t

[PHP] Re: preg_match() occurence position

2002-07-25 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hello, > > Can I get the starting position of my string occurence when using any > regexps searching functions in PHP ? > > for example: > $mem='this is a test'; > preg_match('/test/', ...) should return me somehow: 10 > > > Thanks

[PHP] Re: preg_match or not?

2002-07-06 Thread Steve Fitzgerald
Thanks, thats hit the nail on the head, and my headache is a whole lot better! Steve Cc Zona wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Steve Fitzgerald) wrote: > > > I have been struggling for a couple of hours now trying to write a > > preg_match expression to validate a do

[PHP] Re: preg_match or not?

2002-07-06 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Steve Fitzgerald) wrote: > I have been struggling for a couple of hours now trying to write a > preg_match expression to validate a dollar amount - the user may or may > not put in the decimals so I want to allow only digits plus a possible > pe

[PHP] Re: preg_match vs ereg etc

2002-02-18 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Digitalkoala) wrote: > I was just wondering what your opinions were on using preg_match, preg_split > instead of ereg and explode? > > I have to write a script to parse a lot of html and text files.. and I'm > looking to use the fastest possib