Dev Shed Forums - Regex Programming http://forums.devshed.com/ Regular expressions forum covering PCRE and POSIX techniques, practices, and standards. Regular expressions help shorten coding time by providing the ability to compact many lines of code into one string. en Fri, 15 Dec 2017 08:38:24 GMT vBulletin 60 http://forums.devshed.com/images/misc/rss.png Dev Shed Forums - Regex Programming http://forums.devshed.com/ Replacing Space with New Line Based on Length http://forums.devshed.com/regex-programming/979577-replacing-space-line-based-length-new-post.html Mon, 04 Dec 2017 16:56:57 GMT I don't know if this is possible with just a regexp but I know the right magic can do a lot of things. I can parse the string programmatically but will a regexp do it? I have a table cell that can fit 'n' characters on a line. I am looking for a way to replace a space with a new line character. The space to be replaced needs to be the last one such that the number of characters before it is <=n. The number of characters after that space may also be >n which means multiple replacements. TIA. ]]> Regex Programming gw1500se http://forums.devshed.com/regex-programming-147/replacing-space-line-based-length-979577.html Simple Expression Help http://forums.devshed.com/regex-programming/979540-simple-expression-help-new-post.html Mon, 27 Nov 2017 13:06:45 GMT I would appreciate some help with a simple expression. Here is a sample piece of text I want to search through. Line one. Line two: continued on. Line three. Line four: and now we continue. Line five. I would appreciate some help with a simple expression.
Here is a sample piece of text I want to search through.

Line one.
Line two: continued on.
Line three.

Line four: and now we continue.
Line five.

I want to find everything from the start of a line to a : The expression should select. Line two: Line four:
Can someone please help me build this? I currently have ^[^:]+: but this is not working as it is finding everything up to and including the first :.
Thanks for any help! ]]>
Regex Programming dkalsow http://forums.devshed.com/regex-programming-147/simple-expression-help-979540.html