<?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"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: String.search problem&#8230;</title>
		<atom:link href="http://cycling74.com/forums/topic/string-search-problem/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/string-search-problem/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 03:10:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-35492</guid>
					<title><![CDATA[String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-35492</link>
					<pubDate>Wed, 23 Jan 2008 19:47:46 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>I am trying to process the lines of a file using &#8220;readline&#8221;. <br />
I have pasted my code below. For some reason when I call<br />
the method string &#8220;search&#8221;, I get the following error&#8230;</p>
<p>&#8226; error: js: (null): Javascript SyntaxError: unterminated character class , line 0<br />
&#8226; error: js: error calling function Test</p>
<p>For the life of me, I can not figure this one out. I know<br />
search is a method that exists because I have called <br />
it before with no problems. Anyone have any ideas?</p>
<p>// inlets and outlets<br />
inlets = 1;<br />
outlets = 1;</p>
<p>var 	IniFile = null; <br />
function Test(filename)<br />
{<br />
	if(IniFile != null)<br />
	{<br />
		IniFile.close();<br />
		IniFile = null;<br />
	}</p>
<p>	IniFile = new File(filename, &#8220;read&#8221;);<br />
	if(IniFile.isopen == false)<br />
	{<br />
		post(&#8220;FileIO Error: could not open file.n&#8221;);<br />
		return;<br />
	}<br />
	else<br />
		post(&#8220;file open.n&#8221;);	</p>
<p>	var OutputStr = &#8220;&#8221;;<br />
	IniFile.position = 0;<br />
	post(&#8220;IniFile.position = &#8221; + IniFile.position + &#8220;n&#8221;);<br />
	post(&#8220;IniFile.eof = &#8221; + IniFile.eof + &#8220;n&#8221;);<br />
	var Result = 0;<br />
	var Line = &#8220;&#8221;;<br />
	while(IniFile.position != IniFile.eof)<br />
	{<br />
		Line = IniFile.readline (256);<br />
		post(&#8220;input: &#8221; + Line + &#8220;n&#8221;);<br />
		Result = Line.search(&#8220;[");<br />
		post("search done...n");<br />
		if(Result != -1)<br />
		{<br />
			// remove section delimiters.<br />
			Line.replace("[", "");<br />
			Line.replace("]&#8220;, &#8220;&#8221;);<br />
			OutputStr += Line + &#8221; &#8220;;<br />
		}	<br />
	}</p>
<p>
	outlet(0, OutputStr);	<br />
}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121055</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121055</link>
					<pubDate>Wed, 23 Jan 2008 21:34:16 +0000</pubDate>
					<dc:creator>Patrick Delges</dc:creator>

					<description>
						<![CDATA[
						<p>
On 23-janv.-08, at 20:48, Anthony Palomba wrote:</p>
<p>> For the life of me, I can not figure this one out. I know<br />
> search is a method that exists because I have called<br />
> it before with no problems. Anyone have any ideas?</p>
<p>I can&#8217;t test your code now, but afaik, String.search() expects a <br />
regular expression as argument, but &#8220;[&#8221; doesn&#8217;t look like a RE.</p>
<p>p</p>
<p>
_____________________________<br />
Patrick Delges</p>
<p>Centre de Recherches et de Formation Musicales de Wallonie</p>
<p><a href="http://www.crfmw.be/max" rel="nofollow">http://www.crfmw.be/max</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121056</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121056</link>
					<pubDate>Wed, 23 Jan 2008 23:45:02 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>String.search takes a string and searches it for a <br />
specified substring. It returns -1 or the index of the <br />
beginning of that substring. I am pretty sure this works.</p>
<p>One difference is that when I normally use it, I pass <br />
a string in from outside. In this case I am using fileobject.getline.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121057</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121057</link>
					<pubDate>Wed, 23 Jan 2008 23:49:50 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>On 24 janv. 08, at 00:45, Anthony Palomba wrote:</p>
<p>> String.search takes a string and searches it for a<br />
> specified substring. It returns -1 or the index of the<br />
> beginning of that substring. I am pretty sure this works.</p>
<p>I use it in ej.function, and it works fine.</p>
<p>ej</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121058</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121058</link>
					<pubDate>Wed, 23 Jan 2008 23:54:01 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Jan 23, 2008, at 3:45 PM, Anthony Palomba wrote:</p>
<p>><br />
> String.search takes a string and searches it for a<br />
> specified substring. It returns -1 or the index of the<br />
> beginning of that substring. I am pretty sure this works.</p>
<p>Your error message would suggest it thinks &#8220;[" is the beginning of a  <br />
regexp charset. So for ordinary strings maybe this is true since they  <br />
are the same as their representation as a regular expression.</p>
<p>Try using "[" and "]&#8221; &#8211;i.e. backslash to escape the brackets&#8230;</p>
<p>Let us know what you find.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121059</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121059</link>
					<pubDate>Wed, 23 Jan 2008 23:57:44 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
Btw, the definitive source:</p>
<p><a href="http://developer.mozilla.org/en/docs/" rel="nofollow">http://developer.mozilla.org/en/docs/</a> <br />
Core_JavaScript_1.5_Reference:Objects:String:search</p>
<p>It is a regular expression. So you definitely need to escape brackets  <br />
and the like.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121060</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121060</link>
					<pubDate>Thu, 24 Jan 2008 00:02:33 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>I was referencing this&#8230;</p>
<p><a href="http://www.w3schools.com/jsref/jsref_search.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_search.asp</a></p>
<p>Is this a bad source?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121061</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121061</link>
					<pubDate>Thu, 24 Jan 2008 00:08:04 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Jan 23, 2008, at 4:02 PM, Anthony Palomba wrote:</p>
<p>><br />
> I was referencing this&#8230;<br />
> <a href="http://www.w3schools.com/jsref/jsref_search.asp" rel="nofollow">http://www.w3schools.com/jsref/jsref_search.asp</a><br />
><br />
> Is this a bad source?</p>
<p>Well it would appear that this isn&#8217;t the way it works in JS 1.5 (may  <br />
have been the case in previous versions, or they may be glossing over  <br />
regexp behavior). Core Javascript book and mozilla site I sent in my  <br />
last message are highly recommended</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/string-search-problem/#post-121062</guid>
					<title><![CDATA[Re: String.search problem&#8230;]]></title>
					<link>http://cycling74.com/forums/topic/string-search-problem/#post-121062</link>
					<pubDate>Thu, 24 Jan 2008 16:34:05 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>I went ahead and treated it as a regular expression. Line.search(&#8220;[/[]&#8220;) does the trick. Thanks for helping<br />
me track this one down.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

