Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development

Reply
 
Thread Tools

[regexp] Word boundary
Old 28.07.2004, 07:27   #1
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Blog Entries: 16
Rep Power: 8
Default [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.

Old 28.07.2004, 19:07   #2
Moderator
 
acid's Avatar
 
Join Date: 09 2001
Location: South Korea, Gumi
Posts: 7,699
Blog Entries: 16
Rep Power: 8
Default

it was
PHP Code:
preg_match("/\A(.{1,150}.*?)\b/s", $fullcontent, $smallcontent); 
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 02:54.
Top

Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.