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 , $matches);
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
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 a
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
bruce bedoug...@earthlink.net 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,
@lists.php.net
Subject: [PHP] Re: preg_match question...
bruce bedoug...@earthlink.net 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
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
2009/2/6 Shawn McKenzie nos...@mckenzies.net
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 look at
Shawn McKenzie nos...@mckenzies.net 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:
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
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
In that case you could use the /e trailing option to use strtolower on the
subpattern.
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.
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 other followups
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
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.
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 and I
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 know
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 $
Fred wrote:
Hi
I have problems with a regular expression.
I have a html file like this:
body
divHello/div
br
br
divsomthing/div
br
/body
And i want to use preg_match to get a list of all the div tags in the
file:
result:
$list[0] = divHello/div
$list[1] = divsomthing/div
I have tryed
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
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 only one
preg_matchtry without backslashes.
$pattern = /$search/i;
if (preg_match ($pattern, $date[$i]))
{
echo $date[$i]br /;
}
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 [EMAIL
]
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 without
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 too
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
strpos might
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
period
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 dollar
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 possible
29 matches
Mail list logo