Quantcast
Channel: Pattern.Split doesn't behave as I've expected - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Adrian Larson for Pattern.Split doesn't behave as I've expected

$
0
0

You do indeed have a misunderstanding here. What the tool you're using does is find each matching group, which is more like this script instead:

Pattern urlPattern = Pattern.compile('http.*\\S');String input = 'Test bla bla bla \r http://test.xxxx.com/labs/test/files/unrelateddoc.pdf';Matcher m = urlPattern.matcher(input);while (m.find()) system.debug(m.group());

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>