Re: MYSQL REGEXP question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




No, it shouldn't because there are only two B's, one is followed by a 'v' (one of your exceptions) and the other is at the end of the line, right?

-Micah

Mike van Hoof wrote:
That is it almost :)

SELECT 'oer bv b' REGEXP 'b[^v]$|b[^v]\s?';

gives me 0 as a result, while it shoud give me 1, because there is a b in there which is not bv.

Mike

Medusa, Media Usage Advice B.V.
Science Park Eindhoven 5216
5692 EG SON
tel: 040-24 57 024  fax: 040-29 63 567
url: www.medusa.nl
mail: mike@xxxxxxxxx

Uw bedrijf voor Multimedia op Maat



Micah Stevens schreef:

Your code states:

Match: one of the following letters: -,b,|,^,b negative look ahead one of these: -,v,$,|,v

Which isn't what you're looking for. Remember the negating '^' only works at the start of a [] list. And '$' only means line-end if it's outside [], inside it stands for the '$' character.

I think this would work better:


b[^v]$|b[^v]\s?

HTH,
-Micah

mike@xxxxxxxxxxxxxxxx wrote:
Hello,

i am try to make a regular expression work, but keep getting an error message
does anyone know how i can make it work?
The query is:

SELECT 'boer bv' REGEXP '[ b|^b](?![v$|v ])';

So it has to match each starting 'b' and all the b's pf following words. But now followed by a v(line end) or a v followed by a space.

so it should match:

'b test'
'test b'
'test b bv'
'bv b test'

and NOT

'test bv'
'bv test'

Any idea's?!

Thanks, mike

------------------------------------------------------------------------

AdmID:FB05127CFE0569CA76887DED108E0F2F



**********************************************************************

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.

************************************************************************
<<<<GWAVAsig>>>>




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux