Complex regular expression

Posted by Jose3d on Stack Overflow See other posts from Stack Overflow or by Jose3d
Published on 2011-01-14T20:40:19Z Indexed on 2011/01/14 20:53 UTC
Read the original article Hit count: 198

Filed under:

Hello,

i will like to capture a substring part of a text choosing the number of characters but if any word is cut then get until de last blank.

As example if this is the text:

"This is an example of text lorem ipsum, etc..."

and i would like to get for instance 12 characters that are: "This is an e". In this case example is cutted, then i would like to get "This is an".

Its possible do this with Regular Expressions?

Thanks in advance.

Jose

© Stack Overflow or respective owner

Related posts about regex