PageRenderTime 2027ms queryFilters 0ms Sphinxql 394ms GetByIds 759ms meta 0ms repositoryFilters 585ms languageFilters 9ms sourceFilters 117ms

108,898 results for 'gsub' (2027 ms)

Source

Language

Repository

bluecloth.rb https://github.com/isaac/mephisto.git | Ruby | 1,144 lines
173		# spaces, and a couple of guaranteed newlines at the end
174		text = self.gsub( /\r\n?/, "\n" ).detab
175		text += "\n\n"
180			text.gsub!( "<", "&lt;" )
181			text.gsub!( ">", "&gt;" )
182			@log.debug "Filtered HTML: %p" % text
185		# Simplify blank lines
186		text.gsub!( /^ +$/, '' )
187		@log.debug "Tabs -> spaces/blank lines stripped: %p" % text
225		newstr = self.split( /\n/ ).collect {|line|
226			line.gsub( /(.*?)\t/ ) do
227				$1 + ' ' * (tabwidth - $1.length % tabwidth)
594				gsub( /^/, indent ).
595				gsub( PreChunk ) {|m| m.gsub(/^#{indent}/o, '') }
596			@log.debug "Blockquoted chunk is: %p" % quoted
redcloth.rb https://github.com/isaac/mephisto.git | Ruby | 1,130 lines
307
308        text.gsub!( /<\/?notextile>/, '' )
309        text.gsub!( /x%x%/, '&#38;' )
435    def htmlesc( str, mode )
436        str.gsub!( '&', '&amp;' )
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
438        str.gsub!( "'", '&#039;' ) if mode == :Quotes
439        str.gsub!( '<', '&lt;')
439        str.gsub!( '<', '&lt;')
440        str.gsub!( '>', '&gt;')
441    end
446            next if tog and method( tog ).call
447            text.gsub! re, resub
448        end
rubypants.rb https://github.com/dosire/dosire.git | Ruby | 490 lines
355  def educate_dashes_oldschool(str)
356    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
357  end
369  def educate_dashes_inverted(str)
370    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
371  end
377  def educate_ellipses(str)
378    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
379  end
384  def educate_backticks(str)
385    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
386  end
391  def educate_single_backticks(str)
392    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
393  end
bluecloth.rb https://github.com/dosire/dosire.git | Ruby | 1,144 lines
173		# spaces, and a couple of guaranteed newlines at the end
174		text = self.gsub( /\r\n?/, "\n" ).detab
175		text += "\n\n"
180			text.gsub!( "<", "&lt;" )
181			text.gsub!( ">", "&gt;" )
182			@log.debug "Filtered HTML: %p" % text
185		# Simplify blank lines
186		text.gsub!( /^ +$/, '' )
187		@log.debug "Tabs -> spaces/blank lines stripped: %p" % text
225		newstr = self.split( /\n/ ).collect {|line|
226			line.gsub( /(.*?)\t/ ) do
227				$1 + ' ' * (tabwidth - $1.length % tabwidth)
594				gsub( /^/, indent ).
595				gsub( PreChunk ) {|m| m.gsub(/^#{indent}/o, '') }
596			@log.debug "Blockquoted chunk is: %p" % quoted
rctodb.rb https://github.com/dosire/dosire.git | Ruby | 1,107 lines
292
293        text.gsub!( /<\/?notextile>/, '' )
294        text.gsub!( /x%x%/, '&#38;' )
412    def htmlesc( str, mode )
413        str.gsub!( '&', '&amp;' )
414        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
414        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
415        str.gsub!( "'", '&#039;' ) if mode == :Quotes
416        str.gsub!( '<', '&lt;')
416        str.gsub!( '<', '&lt;')
417        str.gsub!( '>', '&gt;')
418    end
422        GLYPHS.each do |re, resub|
423            text.gsub! re, resub
424        end
redcloth.rb https://github.com/dosire/dosire.git | Ruby | 1,130 lines
307
308        text.gsub!( /<\/?notextile>/, '' )
309        text.gsub!( /x%x%/, '&#38;' )
435    def htmlesc( str, mode )
436        str.gsub!( '&', '&amp;' )
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
438        str.gsub!( "'", '&#039;' ) if mode == :Quotes
439        str.gsub!( '<', '&lt;')
439        str.gsub!( '<', '&lt;')
440        str.gsub!( '>', '&gt;')
441    end
446            next if tog and method( tog ).call
447            text.gsub! re, resub
448        end
bluecloth.rb https://github.com/b/trivium.git | Ruby | 1,222 lines
200		# spaces, and a couple of guaranteed newlines at the end
201		text = self.gsub( /\r\n?/, "\n" ).detab
202		text += "\n\n"
207			text.gsub!( "<", "&lt;" )
208			text.gsub!( ">", "&gt;" )
209			@log.debug "Filtered HTML: %p" % text
212		# Simplify blank lines
213		text.gsub!( /^ +$/, '' )
214		@log.debug "Tabs -> spaces/blank lines stripped: %p" % text
252		newstr = self.split( /\n/ ).collect {|line|
253			line.gsub( /(.*?)\t/ ) do
254				$1 + ' ' * (tabwidth - $1.length % tabwidth)
672				gsub( /^/, indent ).
673				gsub( PreChunk ) {|m| m.gsub(/^#{indent}/o, '') }
674			@log.debug "Blockquoted chunk is: %p" % quoted
rubypants.rb https://github.com/b/trivium.git | Ruby | 490 lines
355  def educate_dashes_oldschool(str)
356    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
357  end
369  def educate_dashes_inverted(str)
370    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
371  end
377  def educate_ellipses(str)
378    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
379  end
384  def educate_backticks(str)
385    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
386  end
391  def educate_single_backticks(str)
392    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
393  end
ruby_pants.rb https://github.com/DoktahWorm/adva_cms.git | Ruby | 490 lines
355  def educate_dashes_oldschool(str)
356    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
357  end
369  def educate_dashes_inverted(str)
370    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
371  end
377  def educate_ellipses(str)
378    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
379  end
384  def educate_backticks(str)
385    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
386  end
391  def educate_single_backticks(str)
392    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
393  end
bluecloth.rb https://github.com/DoktahWorm/adva_cms.git | Ruby | 1,144 lines
173		# spaces, and a couple of guaranteed newlines at the end
174		text = self.gsub( /\r\n?/, "\n" ).detab
175		text += "\n\n"
180			text.gsub!( "<", "&lt;" )
181			text.gsub!( ">", "&gt;" )
182			@log.debug "Filtered HTML: %p" % text
185		# Simplify blank lines
186		text.gsub!( /^ +$/, '' )
187		@log.debug "Tabs -> spaces/blank lines stripped: %p" % text
225		newstr = self.split( /\n/ ).collect {|line|
226			line.gsub( /(.*?)\t/ ) do
227				$1 + ' ' * (tabwidth - $1.length % tabwidth)
594				gsub( /^/, indent ).
595				gsub( PreChunk ) {|m| m.gsub(/^#{indent}/o, '') }
596			@log.debug "Blockquoted chunk is: %p" % quoted
redcloth.rb https://github.com/DoktahWorm/adva_cms.git | Ruby | 1,130 lines
307
308        text.gsub!( /<\/?notextile>/, '' )
309        text.gsub!( /x%x%/, '&#38;' )
435    def htmlesc( str, mode )
436        str.gsub!( '&', '&amp;' )
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
437        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
438        str.gsub!( "'", '&#039;' ) if mode == :Quotes
439        str.gsub!( '<', '&lt;')
439        str.gsub!( '<', '&lt;')
440        str.gsub!( '>', '&gt;')
441    end
446            next if tog and method( tog ).call
447            text.gsub! re, resub
448        end
extract.rb https://github.com/devilcoders/metadata.git | Ruby | 1,452 lines
114        na_re = /[^a-zA-Z0-9_.:;,\{\}\(\)\\\/\[\]\n\t -]/
115        nl = gsub(na_re,'').length
116        if length > 1.5 * nl
149        na_re = /[^a-zA-Z0-9_.:;,\{\}\(\)\\\/\[\]\n\t -]/
150        if us.length > 1.9 * us.gsub(na_re,'').length
151          rcset = cset.sub(/le|$/){|m| m == 'be' ? 'le' : 'be' }
152          nus = ((Iconv.iconv('utf-8', rcset, self)[0]) rescue false)
153          if nus and (nus.gsub(na_re,'').length > us.gsub(na_re,'').length)
154            us = nus
158    end
159    us ||= self.gsub(/[^0-9a-z._ '"\*\+\-]/,'?')
160    us.sub!(/\A(\x00\x00\xFE\xFF|(\xFF\xFE(\x00\x00)?)|\xEF\xBB\xBF|\xFE\xFF)/, '') # strip UTF BOMs
249      STDERR.puts "  Trying #{mt}" if verbose
250      mn = mt.to_s.gsub(/[^a-z0-9]/i,"_")
251      if new_methods.include?( mn )
oldredcloth.rb https://github.com/rab1234/KissWiki.git | Ruby | 1,114 lines
293
294        text.gsub!( /<\/?notextile>/, '' )
295        text.gsub!( /x%x%/, '&#38;' )
417    def htmlesc( str, mode )
418        str.gsub!( '&', '&amp;' )
419        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
419        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
420        str.gsub!( "'", '&#039;' ) if mode == :Quotes
421        str.gsub!( '<', '&lt;')
421        str.gsub!( '<', '&lt;')
422        str.gsub!( '>', '&gt;')
423    end
428            next if tog and method( tog ).call
429            text.gsub! re, resub
430        end
plot_evaluations.R https://bitbucket.org/dalloliogm/leipzig_feedback_2013 | Unknown | 227 lines
98    feedback.overall.long$question <- factor(feedback.overall.long$variable)
99    feedback.overall.long$question <- gsub("(\\w*\\.\\w*\\.\\w*\\.\\w*\\.\\w*\\.\\w*\\.\\w*)\\.", "\\1\n", feedback.overall.long$question, perl=T)
100    feedback.overall.long$question <- gsub("\n$", "", feedback.overall.long$question, perl=T)
100    feedback.overall.long$question <- gsub("\n$", "", feedback.overall.long$question, perl=T)
101    feedback.overall.long$question <- gsub("\\.", " ", feedback.overall.long$question, perl=T)
102    # FIX: manually fixing some labels
102    # FIX: manually fixing some labels
103    feedback.overall.long$question <- gsub("What did .*ratio of teaching versus scientific lectures\n", "What did you think\nof the ratio of teaching versus\nscientific lectures", feedback.overall.long$question, perl=T)
104    feedback.overall.long$question <- gsub("In general.*\n.*\n.*", "In general what did\nyou think about the length\nof the course", feedback.overall.long$question, perl=T)
106    feedback.overall.long$answer <- factor(feedback.overall.long$value)
107    feedback.overall.long$answer <- gsub("^mailing.*", "Mailing list\n(Institute/\nDepartment/\nother)", feedback.overall.long$answer, perl=T)
108    feedback.overall.long$answer <- gsub("^I.*needed", "I needed", feedback.overall.long$answer, perl=T)
108    feedback.overall.long$answer <- gsub("^I.*needed", "I needed", feedback.overall.long$answer, perl=T)
109    feedback.overall.long$answer <- gsub("^internal.*", "Mailing list\n(Institute/\nDepartment/\nother)", feedback.overall.long$answer, perl=T)
110    feedback.overall.long$answer <- gsub("^Department.*", "Mailing list\n(Institute/\nDepartment/\nother)", feedback.overall.long$answer, perl=T)
migrate_from_trac.rake https://bitbucket.org/marutosi/redmine-gh-new-rails3-20120509-git.git | Ruby | 773 lines
255
256          u.login = username[0, User::LOGIN_LENGTH_LIMIT].gsub(/[^a-z0-9_\-@\.]/i, '-')
257          u.password = 'trac'
278        # Titles
279        text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
280        # External Links
280        # External Links
281        text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
282        # Ticket links:
303        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
304        text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
305        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
570              next unless attachment.exist?
571              next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
572              attachment.open {
package.lua https://bitbucket.org/dbindel/axfem.git | Lua | 343 lines
37 local L = {}
38 self.code = gsub(self.code,"\n%s*%$%[","\1") -- deal with embedded lua code
39 self.code = gsub(self.code,"\n%s*%$%]","\2")
39 self.code = gsub(self.code,"\n%s*%$%]","\2")
40 self.code = gsub(self.code,"(%b\1\2)",       function (c)
41                                               tinsert(L,c)
45 local C = {}
46 self.code = gsub(self.code,"\n%s*%$%<","\3") -- deal with embedded C code
47 self.code = gsub(self.code,"\n%s*%$%>","\4")
47 self.code = gsub(self.code,"\n%s*%$%>","\4")
48 self.code = gsub(self.code,"(%b\3\4)",       function (c)
49                                               tinsert(C,c)
52 -- avoid preprocessing embedded C code
53 self.code = gsub(self.code,"\n%s*%$%{","\5") -- deal with embedded C code
54 self.code = gsub(self.code,"\n%s*%$%}","\6")
generate_spec.rb https://bitbucket.org/hacman/quickfix.git | Ruby | 401 lines
71  def toFieldName( fieldName, type )
72    fieldName = fieldName.split(" (")[0].split("(")[0].strip.gsub(' ', '')
73    fieldName.gsub!("UnitofMeasure", "UnitOfMeasure")
92    description.strip!
93    description.gsub!('&quot;', '')
94    description.gsub!('+ ', '+')
94    description.gsub!('+ ', '+')
95    description.gsub!(',', '_')
96    description.gsub!(' ', '_')
96    description.gsub!(' ', '_')
97    description.gsub!('-', '_')
98    description.gsub!('–', '')
98    description.gsub!('–', '')
99    description.gsub!('/', '_')
100    description.gsub!('+', ' PLUS ')
getlyric.rb https://bitbucket.org/eamoon/bin.git | Ruby | 240 lines
30def save_lyrics(lyric)
31  lyric.gsub!('&amp;', '&')
32  lyric.gsub!('&lt;', '<')
32  lyric.gsub!('&lt;', '<')
33  lyric.gsub!('&gt;', '>')
34  lyric.gsub!(/&#([0-9]+);/) { $1.to_i.chr }
34  lyric.gsub!(/&#([0-9]+);/) { $1.to_i.chr }
35  lyric.gsub!(/\n\n \n\n/, "\n\n")
36  lyric.gsub!('<i>', '(')
36  lyric.gsub!('<i>', '(')
37  lyric.gsub!('</i>', ')')
38  puts lyric
44def tidy(lyric)
45  lyric = lyric.gsub(/<div.+?<\/div>/m, '')
46  lyric = lyric.gsub(/<script.+?<\/script>/m, '')
realindex.html https://bitbucket.org/sortsmill/sortsmill-tools.git | HTML | 2,002 lines
68	    GSUB) -->
69	    <A TARGET="_top" HREF="gposgsub.html#GSUB">?????</A> (GSUB ?)
70	  <LI>
444	    <A NAME="Contextual-Substitution-GSUB">GSUB</A>) -->
445	    <A TARGET="_top" HREF="gposgsub.html#GSUB">???????</A> (<A NAME="Contextual-Substitution-GSUB">GSUB</A> ????)
446	    <UL>
1309	    GSUB) -->
1310	    <A TARGET="_top" HREF="gposgsub.html#GSUB">????</A> (GSUB ????)
1311	</UL>
1534	    substitution</A> (in GSUB) (not supported) -->
1535	    <A TARGET="_top" HREF="gposgsub.html#GSUB">???????????</A> (GSUB ????) (?????)
1536	  <LI>
1624<!--  ?	  <A TARGET="_top" HREF="gposgsub.html#GSUB">single substitution</A> (in GSUB) -->
1625	    <A TARGET="_top" HREF="gposgsub.html#GSUB">????</A> (GSUB ????)
1626	  <LI>
migrate_from_trac.rake https://bitbucket.org/eimajenthat/redmine.git | Ruby | 773 lines
255
256          u.login = username[0, User::LOGIN_LENGTH_LIMIT].gsub(/[^a-z0-9_\-@\.]/i, '-')
257          u.password = 'trac'
278        # Titles
279        text = text.gsub(/^(\=+)\s(.+)\s(\=+)/) {|s| "\nh#{$1.length}. #{$2}\n"}
280        # External Links
280        # External Links
281        text = text.gsub(/\[(http[^\s]+)\s+([^\]]+)\]/) {|s| "\"#{$2}\":#{$1}"}
282        # Ticket links:
303        text = text.gsub(/\[wiki:\"(.+)\".*\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
304        text = text.gsub(/\[wiki:([^\s\]]+)\]/) {|s| "[[#{$1.delete(',./?;|:')}]]"}
305        text = text.gsub(/\[wiki:([^\s\]]+)\s(.*)\]/) {|s| "[[#{$1.delete(',./?;|:')}|#{$2.delete(',./?;|:')}]]"}
570              next unless attachment.exist?
571              next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
572              attachment.open {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21