Goldeneye Posted May 18, 2010 Share Posted May 18, 2010 What would I use to explicitly match strings that do not span multiple lines? I thought, (.\S?) (instead of the less partial (.*?)) would do accomplish what I want, but it doesn`t. I`ve also searched around (this forum included) but haven`t found anything relevant which leads me to believe that I might be over-thinking this. Quote Link to comment Share on other sites More sharing options...
Goldeneye Posted May 19, 2010 Author Share Posted May 19, 2010 Okay, I have figured out what I was doing wrong, and as embarrassing as this is... I should've been using (\S*?) instead of (.*?). I was simply replacing the wrong character with the \S. This hit me when I realized that periods (.) tell the regex to match any character except for a linebreak. My regular expression does appear to be working now. So, if you want a sub-class to match anything up to a linebreak, tab, space, or return; use: (\S*?). It should be noted that \S symbolizes non-whitespace characters Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.