<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ankit Jain &#187; regexp</title>
	<atom:link href="http://ankitjain.info/ankit/tag/regexp/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankitjain.info/ankit</link>
	<description>» It’s all about Ankit and Web! «</description>
	<lastBuildDate>Mon, 28 Jun 2010 06:28:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Split Pascalcase String</title>
		<link>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/</link>
		<comments>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:32:12 +0000</pubDate>
		<dc:creator>Ankit</dc:creator>
				<category><![CDATA[Programming/Code]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[regexp]]></category>

		<guid isPermaLink="false">http://ankitjain.info/ankit/?p=344</guid>
		<description><![CDATA[Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java: String camelCase = "StructuralDesignPattern"; StringBuffer label = new StringBuffer(camelCase + 10); java.util.regex.Pattern p = java.util.regex.Pattern.compile("[A-Z][a-z]+"); java.util.regex.Matcher m [...]]]></description>
			<content:encoded><![CDATA[<p>Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java:<br />
<code><br />
		    String camelCase = "StructuralDesignPattern";<br />
		    StringBuffer label = new StringBuffer(camelCase + 10);<br />
		    java.util.regex.Pattern p = java.util.regex.Pattern.compile("[A-Z][a-z]+");<br />
		    java.util.regex.Matcher m = p.matcher(camelCase);<br />
		    while ( m.find() )<br />
		    {<br />
			label.append( m.group() + " ");<br />
		    }<br />
		    System.out.println(camelCase + " >> " + label.toString());<br />
</code></p>
<p>[ Note: this does not work for all test cases. You may also want to try regexp as <em>"[A-Z][a-z]+&#8221;</em>, for matching any continues uppercase letters too (e.g. AnkitJainFROMIndia >> Ankit Jain FROMIndia) ]</p>
<p>Jon Galloway <a target="_blank" href="http://weblogs.asp.net/jgalloway/archive/2005/09/27/426087.aspx">points out a tricky method</a> for C#.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankitjain.info/ankit/2009/09/11/spliting-camelcase-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
