PageRenderTime 36ms queryFilters 1ms Sphinxql 101ms GetByIds 285ms meta 0ms repositoryFilters 321ms languageFilters 2ms sourceFilters 36ms

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

Source

Language

Repository

gsub.c https://bitbucket.org/pathpot/pocket-fighter | C | 1,715 lines
18#include <AR/ar.h>
19#include <AR/gsub.h>
20
gsub-i.ri https://bitbucket.org/aetos/tddbc_yokohama2 | Unknown | 15 lines
1U:RDoc::AnyMethod[iI"	gsub:EFI"String#gsub;FF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"FReturns a copy of <i>str</i> with the <em>all</em> occurrences of;FI"N<i>pattern</i> substituted for the second argument. The <i>pattern</i> is;FI"Ltypically a <code>Regexp</code>; if given as a <code>String</code>, any;FI"Fregular expression metacharacters it contains will be interpreted;FI"Oliterally, e.g. <code>'\\\d'</code> will match a backlash followed by 'd',;FI"instead of a digit.;Fo:RDoc::Markup::BlankLineo;
2;	[I"NIf <i>replacement</i> is a <code>String</code> it will be substituted for;FI"Nthe matched text. It may contain back-references to the pattern's capture;FI"Ogroups of the form <code>\\\d</code>, where <i>d</i> is a group number, or;FI"E<code>\\\k<n></code>, where <i>n</i> is a group name. If it is a;FI"Fdouble-quoted string, both back-references must be preceded by an;FI"Oadditional backslash. However, within <i>replacement</i> the special match;FI"Mvariables, such as <code>&$</code>, will not refer to the current match.;Fo;o;
5;	[I"LThe result inherits any tainting in the original string or any supplied;FI"replacement string.;Fo;o;
6;	[I"?When neither a block nor a second argument is supplied, an;FI")<code>Enumerator</code> is returned.;Fo;o:RDoc::Markup::Verbatim;	[I"   ;FI">"hello".gsub(/[aeiou]/, '*')                  #=> "h*ll*";FI"
7;FI"   ;FI"B"hello".gsub(/([aeiou])/, '<\1>')             #=> "h<e>ll<o>";FI"
7;FI"   ;FI"B"hello".gsub(/([aeiou])/, '<\1>')             #=> "h<e>ll<o>";FI"
8;FI"   ;FI"M"hello".gsub(/./) {|s| s.ord.to_s + ' '}      #=> "104 101 108 108 111 ";FI"
9;FI"   ;FI"B"hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}')  #=> "h{e}ll{o}";FI"
9;FI"   ;FI"B"hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}')  #=> "h{e}ll{o}";FI"
10;FI"   ;FI">'hello'.gsub(/[eo]/, 'e' => 3, 'o' => '*')    #=> "h3ll*";FI"Ăstr.gsub(pattern, replacement)       -> new_str
11str.gsub(pattern, hash)              -> new_str
11str.gsub(pattern, hash)              -> new_str
12str.gsub(pattern) {|match| block }   -> new_str
13str.gsub(pattern)                    -> enumerator
gsub(;..;) { %7Cmatch%7C .. } (gsu).plist https://bitbucket.org/missdeer/luapack | Unknown | 17 lines
5	<key>content</key>
6	<string>gsub(/${1:pattern}/) { ${2/(^(?&lt;var&gt;\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g&lt;var&gt;)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?&lt;var&gt;\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g&lt;var&gt;)*,?\s*$)|.*/(?1:| )/}$0 }</string>
7	<key>name</key>
7	<key>name</key>
8	<string>gsub(/../) { |match| .. }</string>
9	<key>scope</key>
renderer.nim https://bitbucket.org/ivanhernandez/nimrod.git | Unknown | 1,249 lines
472
473proc gsub(g: var TSrcGen, n: PNode, c: TContext)
474proc gsub(g: var TSrcGen, n: PNode) = 
476  initContext(c)
477  gsub(g, n, c)
478
497    if not fits(g, sublen) and (ind + sublen < maxLineLen): optNL(g, ind)
498    gsub(g, n.sons[i])
499    if c: 
526           theEnd: int = - 1) = 
527  for i in countup(start, sonsLen(n) + theEnd): gsub(g, n.sons[i], c)
528
536    optNL(g)
537    gsub(g, n.sons[i], c)
538    gcoms(g)
gsub_spec.rb https://bitbucket.org/nicksieger/rubyspec.git | Ruby | 405 lines
3
4describe "String#gsub with pattern and replacement" do
5
6  it "doesn't freak out when replacing ^" do
7    "Text\n".gsub(/^/, ' ').should == " Text\n"
8    "Text\nFoo".gsub(/^/, ' ').should == " Text\n Foo"
11  it "returns a copy of self with all occurrences of pattern replaced with replacement" do
12    "hello".gsub(/[aeiou]/, '*').should == "h*ll*"
13
14    str = "hello homely world. hah!"
15    str.gsub(/\Ah\S+\s*/, "huh? ").should == "huh? homely world. hah!"
16
16
17    "hello".gsub(//, ".").should == ".h.e.l.l.o."
18  end
funstack.awk https://bitbucket.org/dabomb69/bash-portable | AWK | 978 lines
212	}
213	gsub(/\\-/,"",Journal)	# remove discretionary hyphens
214}
234	Month = ($0 ~ /[=] *"/) ? get_value($0) : get_abbrev($0)
235	gsub(/[\"]/,"",Month)
236	gsub(/ *# *\\slash *# */," / ",Month)
236	gsub(/ *# *\\slash *# */," / ",Month)
237	gsub(/ *# *-+ *# */," / ",Month)
238	n = split(Month,parts," */ *")
370
371		gsub(/{\\\a}/,	"\\&agrave;",	s)
372		gsub(/{\\'a}/,	"\\&aacute;",	s)
372		gsub(/{\\'a}/,	"\\&aacute;",	s)
373		gsub(/{\\[\^]a}/,"\\&acirc;",	s)
374		gsub(/{\\~a}/,	"\\&atilde;",	s)
genreadme.awk https://bitbucket.org/dabomb69/pkgsrc | AWK | 853 lines
91			pkgcat = pkg;
92			gsub(/\/.*/, "", pkgcat);
93			pkgdir=pkgcat "/" pkgdir;
132	dir = $2;
133	gsub(/^comment[ \t]*/, "");
134	tmp = substr($0, length($1) + 1);
134	tmp = substr($0, length($1) + 1);
135	gsub(/^[ \t]*/, "", tmp);
136	gsub(/&/, "\\\\\\&amp;", tmp);
142	homepage[$2] = $3;
143	gsub(/&/, "\\\\&", homepage[$2]);
144	next;
161	# makes lesser awks puke.
162	gsub(/README.html/, readme_name, htmlname);
163	dir2htmlname[dir] = htmlname;
string.rb https://github.com/Vizzuality/cartodb-rb-client.git | Ruby | 116 lines
11    n = str.force_encoding("UTF-8")
12    n.gsub!(/[àáâãäåāă]/,   'a')
13    n.gsub!(/æ/,            'ae')
16    n.gsub!(/[èéêëēęěĕė]/,   'e')
17    n.gsub!(/ƒ/,             'f')
18    n.gsub!(/[ĝğġģ]/,        'g')
62   return if self.blank?
63   self.gsub(/<[^>]+>/m,'').normalize.downcase.gsub(/&.+?;/,'-').
64        gsub(/[^a-z0-9 _-]/,'-').strip.gsub(/\s+/,'-').gsub(/-+/,'-').
64        gsub(/[^a-z0-9 _-]/,'-').strip.gsub(/\s+/,'-').gsub(/-+/,'-').
65        gsub(/-/,' ').strip.gsub(/ /,'-').gsub(/-/,'_')
66  end
99  def sanitize_sql
100    self.gsub(/\\/, '\&\&').gsub(/'/, "''")
101  end
response.rb https://github.com/MythriNagaraju/expertiza.git | Ruby | 1,327 lines
49      if reviewScore.comments != nil
50        code += '<TR><TD valign="top"><B>Response:</B></TD><TD>' + reviewScore.comments.gsub("<","&lt;").gsub(">","&gt;").gsub(/\n/,'<BR/>')
51      end
55    if self.additional_comment != nil
56      comment = self.additional_comment.gsub('^p','').gsub(/\n/,'<BR/>&nbsp;&nbsp;&nbsp;')
57    else
807  code = code + "<i>Compliment:</i>"
808    code = code + "<ul><li>#{review_scores[8].comments.gsub(/\"/,'&quot;').to_s}</li><li>#{review_scores[9].comments.gsub(/\"/,'&quot;').to_s}</li></ul>"
809  code = code + "<i>Suggestion:</i>"
809  code = code + "<i>Suggestion:</i>"
810    code = code + "<ul><li>#{review_scores[10].comments.gsub(/\"/,'&quot;').to_s}</li><li>#{review_scores[11].comments.gsub(/\"/,'&quot;').to_s}</li></ul>"
811
814    code = code + "<br/>How many sources are in the references list?: #{review_scores[12].comments.gsub(/\"/,'&quot;').to_s}<br/>"
815    code = code + "<br/>List the range of publication years for all sources, e.g. 1998-2006: <b>#{review_scores[13].comments.gsub(/\"/,'&quot;').to_s} - #{review_scores[14].comments.gsub(/\"/,'&quot;').to_s}</b><br/><br/>"
816
data.r https://github.com/systematicinvestor/SIT.git | Unknown | 1,438 lines
82	# remove all formating							
83	temp = gsub(pattern = '<.*?>', replacement = '', temp, perl = TRUE) 
84		
86	temp = gsub(pattern = '\n', replacement = '', temp, perl = TRUE) 
87	temp = gsub(pattern = '\t', replacement = '', temp, perl = TRUE) 
88	temp = gsub(pattern = '&nbsp;', replacement = '', temp, perl = TRUE) 
88	temp = gsub(pattern = '&nbsp;', replacement = '', temp, perl = TRUE) 
89	temp = gsub(pattern = '&amp;', replacement = '', temp, perl = TRUE) 
90	temp = gsub(pattern = '&raquo;', replacement = '', temp, perl = TRUE) 		
1289		month = temp[,1]
1290		day = gsub('\\(','',gsub('\\)','',temp[,2]))
1291			day = trim(day)
1321	day = tolower(data[,2])
1322	day = gsub(',', '-', gsub('and', '', gsub('conference call', '', gsub('meeting','',day))))
1323	# remove last token
string.rb https://github.com/netconstructor/cartoset.git | Ruby | 102 lines
11   n = str
12   n.gsub!(/[àáâãäåāă]/,    'a')
13   n.gsub!(/æ/,            'ae')
16   n.gsub!(/[èéêëēęěĕė]/,   'e')
17   n.gsub!(/ƒ/,             'f')
18   n.gsub!(/[ĝğġģ]/,        'g')
63   return if self.blank?
64   self.gsub(/<[^>]+>/m,'').normalize.downcase.gsub(/&.+?;/,'-').
65    gsub(/[^a-z0-9 _-]/,'-').strip.gsub(/\s+/,'-').gsub(/-+/,'-').
65    gsub(/[^a-z0-9 _-]/,'-').strip.gsub(/\s+/,'-').gsub(/-+/,'-').
66    gsub(/-/,' ').strip.gsub(/ /,'-').gsub(/-/,'_')
67  end
91  def sanitize_sql!
92    self.gsub(/\\/, '\&\&').gsub(/'/, "''")
93  end
genminilua.lua https://bitbucket.org/minux/luajit-2.0.git | Lua | 428 lines
8
9local sub, match, gsub = string.sub, string.match, string.gsub
10
45local REMOVE_LIB = {}
46gsub([[
47collectgarbage dofile gcinfo getfenv getmetatable load print rawequal rawset
155local function merge_includes(src)
156  return gsub(src, '#include%s*"([^"]*)"%s*\n', function(name)
157    if includes[name] then return "" end
161    assert(fp:close())
162    src = gsub(src, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "")
163    src = gsub(src, "#endif%s*$", "")
172local function fold_lines(src)
173  return gsub(src, "\\\n", " ")
174end
redcloth3.rb https://bitbucket.org/marutosi/redmine-gh-new-rails3-20120509-git.git | Ruby | 1,209 lines
310
311        text.gsub!( /<\/?notextile>/, '' )
312        text.gsub!( /x%x%/, '&#38;' )
443      if str
444        str.gsub!( '&', '&amp;' )
445        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
445        str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
446        str.gsub!( "'", '&#039;' ) if mode == :Quotes
447        str.gsub!( '<', '&lt;')
447        str.gsub!( '<', '&lt;')
448        str.gsub!( '>', '&gt;')
449      end
456        #    next if tog and method( tog ).call
457        #    text.gsub! re, resub
458        #end
hooks.rb https://bitbucket.org/tifan/elinks.git | Ruby | 229 lines
85  if url.match(/http:\/\/edulinux.homeunix.org\/elinks-render\.html/)
86    html.gsub!(/(<p class=\"example\">)(.*?)(<\/p>)/, '<h2><font color="red">\2</font></h2>')
87    return html
101            # we know what the link references.  :)
102            html.gsub!(/<(img.*?)>(faq|search|memberlist|usergroups|register|profile|you have no new messages|log out \[.*?\]|chat room<\/a>)/i,'\2')
103
104            # Remove the long list of relative links (I don't like them).
105            html.gsub!(/<link rel.*? \/>/,'')
106
107            # Turn on borders for the "main" table.
108            html.gsub!(/(<table class=\"forumline\".*border=)(\".*?\")(.*?>)/,'\11\3')
109            
111            # link, and just display their status instead.
112            html.gsub!(/(<span class=\"postdetails\">.*?)(<img src.*? \/>)/i,'\1')
113
rubypants.rb https://bitbucket.org/emraher/r-notebook.git | Ruby | 489 lines
354  def educate_dashes_oldschool(str)
355    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
356  end
368  def educate_dashes_inverted(str)
369    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
370  end
376  def educate_ellipses(str)
377    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
378  end
383  def educate_backticks(str)
384    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
385  end
390  def educate_single_backticks(str)
391    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
392  end
rubypants.rb https://bitbucket.org/ramnathv/r-notebook.git | Ruby | 489 lines
354  def educate_dashes_oldschool(str)
355    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
356  end
368  def educate_dashes_inverted(str)
369    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
370  end
376  def educate_ellipses(str)
377    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
378  end
383  def educate_backticks(str)
384    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
385  end
390  def educate_single_backticks(str)
391    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
392  end
redcloth_for_tex.rb https://bitbucket.org/mumbly/openbrewcomp.git | Ruby | 737 lines
6  def texesc!( mode )
7    gsub!( '&', '\\\\&' )
8    gsub!( '%', '\%' )
8    gsub!( '%', '\%' )
9    gsub!( '$', '\$' )
10    gsub!( '~', '$\sim$' )
15def table_of_contents(text, pages)
16  text.gsub( /^([#*]+? .*?)$(?![^#*])/m ) do |match|
17    lines = match.split( /\n/ )
22        tl,content = $~[1..2]
23        content.gsub! /[\[\]]/, ""
24        content.strip!
227    
228    text.gsub!(/\[\[(.*?)\]\]/, "\\1")
229    text.gsub!(/_/, "\\_")
rubypants.rb https://bitbucket.org/d1egoaz/d1egoaz-blog.git | Ruby | 490 lines
354  def educate_dashes_oldschool(str)
355    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
356  end
368  def educate_dashes_inverted(str)
369    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
370  end
376  def educate_ellipses(str)
377    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
378  end
383  def educate_backticks(str)
384    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
385  end
390  def educate_single_backticks(str)
391    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
392  end
rubypants.rb https://bitbucket.org/sunng/readwise-blogging.git | Ruby | 489 lines
354  def educate_dashes_oldschool(str)
355    str.gsub(/---/, '&#8212;').gsub(/--/, '&#8211;')
356  end
368  def educate_dashes_inverted(str)
369    str.gsub(/---/, '&#8211;').gsub(/--/, '&#8212;')
370  end
376  def educate_ellipses(str)
377    str.gsub('...', '&#8230;').gsub('. . .', '&#8230;')
378  end
383  def educate_backticks(str)
384    str.gsub("``", '&#8220;').gsub("''", '&#8221;')
385  end
390  def educate_single_backticks(str)
391    str.gsub("`", '&#8216;').gsub("'", '&#8217;')
392  end
gposgsub.html https://bitbucket.org/sortsmill/sortsmill-tools.git | HTML | 1,546 lines
274  <H3>
275<!--  The <B><CODE><A NAME="GSUB">GSUB</A></CODE></B> table-->
276      <B><CODE><A NAME="GSUB">GSUB</A></CODE></B> ????
570  from feature type/setting to opentype tags). -->
571  FontFonge ?? <CODE>&lsquo;mort&rsquo;</CODE>  (?????) ????? <CODE>&lsquo;<A NAME="morx">morx</A>&rsquo;</CODE> (???????) ?????????????????????????? <A HREF="#GSUB">GSUB</A> ???????????????: OpenType ??????????????????????/?????????????? OpenType ???????????????/??????????????Apple ?????????????? (FontForge ???/???? OpenType ???????????????<A HREF="prefs.html#Mac"><CODE>????(<U>F</U>)</CODE>?<CODE>????(<U>E</U>)...</CODE></A> ?????????)?
572  <TABLE BORDER CELLPADDING="2">
878        the case</A>.</TD> -->
879      <TD ROWSPAN="2" VALIGN="Top">???? GSUB ??????????????????????????????????????????? (??????????????) ??????????&lsquo;morx&rsquo;???????????????????????????????????????????????????<A HREF="gposgsub.html#sometimes">???????????????????????</A>
880    </TR>
1453  may adjust it with the <A HREF="fontinfo.html#Order">Element-&gt;Font Info</A>
1454  command. (this is the same list as that used for GSUB table. GSUB features
1455  that don't correspond to mac features will be ignored). -->
1455  that don't correspond to mac features will be ignored). -->
1456  FontForge ? morx ??????????????????????? <A HREF="fontinfo.html#Order"><CODE>?????(<U>L</U>)</CODE>?<CODE>??????(<U>F</U>)...</CODE></A> ??????????????????(??? GSUB ???????????????????????Mac ?????????? GSUB ?????????)?
1457  <H2>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21