AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > Web Development
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Web Development Java/PHP/Perl/ASP and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Jul 28, 2004, 07:27   #1
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: Yerevan, Armenia
Posts: 7,161
Blog Entries: 15
Rep Power: 10
Reputation: 298
[regexp] Word boundary

How to build the following regexp using PHP preg_match(...) ?

Match all characters beginning from position 0, maximum N characters and aligned to word boundary. So total number of characters will be N + number of characters used to align to word boundary. Text is multiline.
__________________
Chat with acid


acid is offline   Reply With Quote Quote selected
Old Jul 28, 2004, 19:07   #2
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: Yerevan, Armenia
Posts: 7,161
Blog Entries: 15
Rep Power: 10
Reputation: 298
it was
PHP Code:
preg_match("/\A(.{1,150}.*?)\b/s"$fullcontent$smallcontent); 
__________________
Chat with acid


acid is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:46.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link