ryan011235 1 Posted April 12, 2015 Report Share Posted April 12, 2015 sample1: RED +1.25sample2: YELLOW -0.40 How do I take all the RED and YELLOW? [\s0-9a-zA-Z]+(?=\ \+) This can only take RED. Quote Link to post Share on other sites
Bot-Factory 602 Posted April 12, 2015 Report Share Posted April 12, 2015 sample1: RED +1.25sample2: YELLOW -0.40 How do I take all the RED and YELLOW? [\s0-9a-zA-Z]+(?=\ \+) This can only take RED. .+(?=\ ) Will pick everything up to the first space. Dan Quote Link to post Share on other sites
ryan011235 1 Posted April 13, 2015 Author Report Share Posted April 13, 2015 thank you and sorry dan! my sample is somthing wrong sample1: RED APPLE +1.25 sample2: YELLOW BANANA -0.40 Quote Link to post Share on other sites
Marton 48 Posted April 14, 2015 Report Share Posted April 14, 2015 thank you and sorry dan! my sample is somthing wrong sample1: RED APPLE +1.25sample2: YELLOW BANANA -0.40 ^.+?(?=\s) Above regex in action: http://regexhero.net/tester/?id=8075477b-1003-4e00-b0a7-a1820db4baf9(check "Real-time highlighting" at the right side if you test different values) Marton Quote Link to post Share on other sites
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.