PageRenderTime 211ms queryTime 74ms sortTime 6ms getByIdsTime 35ms findMatchingLines 11ms

100+ results results for 'gsub repo:glassscribe/rails' (211 ms)

Not the results you expected?
kramdown.rb git://github.com/gettalong/kramdown.git | Ruby | 448 lines
                    
77        else
                    
78          el.value.gsub(/\A\n/) do
                    
79            opts[:prev] && opts[:prev].type == :br ? '' : "\n"
                    
79            opts[:prev] && opts[:prev].type == :br ? '' : "\n"
                    
80          end.gsub(/\s+/, ' ').gsub(ESCAPED_CHAR_RE) { "\\#{$1 || $2}" }
                    
81        end
                    
85        w = @options[:line_width] - opts[:indent].to_s.to_i
                    
86        first, second, *rest = inner(el, opts).strip.gsub(/(.{1,#{w}})( +|$\n?)/, "\\1\n").split(/\n/)
                    
87        first&.gsub!(/^(?:(#|>)|(\d+)\.|([+-]\s))/) { $1 || $3 ? "\\#{$1 || $3}" : "#{$2}\\." }
                    
87        first&.gsub!(/^(?:(#|>)|(\d+)\.|([+-]\s))/) { $1 || $3 ? "\\#{$1 || $3}" : "#{$2}\\." }
                    
88        second&.gsub!(/^([=-]+\s*?)$/, "\\\1")
                    
89        res = [first, second, *rest].compact.join("\n") + "\n"
                    
303      def convert_img(el, _opts)
                    
304        alt_text = el.attr['alt'].to_s.gsub(ESCAPED_CHAR_RE) { $1 ? "\\#{$1}" : $2 }
                    
305        src = el.attr['src'].to_s
                    
                
predefhd.h git://github.com/clj/kroc_scons.git | C Header | 323 lines
                    
31#define PD_LONGSUM                    1
                    
32#define PD_LONGSUB                    2
                    
33#define PD_LONGDIFF                   3
                    
                
flashgetdownloader.h https://bitbucket.org/knoss/pcmanager/ | C Header | 559 lines
                    
51			sss.hRegRootKey = HKEY_LOCAL_MACHINE;
                    
52			sss.pszRegSubKey = _T("SOFTWARE\\FlashGet Network\\FlashGet 3");
                    
53			sss.pszPathValue = _T("Path");
                    
124			sss.hRegRootKey          = HKEY_CURRENT_USER;
                    
125			sss.pszRegSubKey         = TEXT( "Software\\BitComet" );
                    
126			sss.pszPathValue      	 = TEXT( "" );
                    
                
test_externals.py https://bitbucket.org/durin42/hgsubversion/ | Python | 396 lines
                    
326        changes = [
                    
327            ('.hgsub', '.hgsub', """\
                    
328dir/deps/project2 = [hgsubversion] dir:^/externals/project2 deps/project2
                    
331"""),
                    
332            ('.hgsubstate', '.hgsubstate', """\
                    
333HEAD dir/deps/project2
                    
346
                    
347        # Check .hgsub and .hgsubstate were not pushed
                    
348        self.assertEqual(['dir', 'subdir1', 'subdir1/a', 'subdir2',
                    
353        changes = [
                    
354            ('.hgsub', '.hgsub', """\
                    
355subdir1/deps/project1 = [hgsubversion] subdir1:^/externals/project1 deps/project1
                    
357"""),
                    
358            ('.hgsubstate', '.hgsubstate', """\
                    
359HEAD subdir1/deps/project1
                    
                
Enumerator2.rb https://github.com/MagLev/maglev.git | Ruby | 689 lines
                    
599
                    
600  class StringGsubEnumerator < Enumerator # 
                    
601    def initialize(obj, enum_sel, regex)
                    
685  ArrayEnumerator = Enumerable::ArrayEnumerator
                    
686  StringGsubEnumerator = Enumerable::StringGsubEnumerator 
                    
687end
                    
                
GraphicsUtilities.m http://networkpx.googlecode.com/svn/trunk/ | Objective C | 340 lines
                    
72									   CGRect bgSubRect) {
                    
73	GUCreateContext(c, bgSubRect.size.width, bgSubRect.size.height);
                    
74	CGImageRef subimage = NULL;
                    
75	if (background != NULL) {
                    
76		if (bgSubRect.size.width == CGImageGetWidth(background) && bgSubRect.size.height == CGImageGetHeight(background))
                    
77			subimage = CGImageRetain(background);
                    
79			subimage = CGImageCreateWithImageInRect(background, bgSubRect);
                    
80		CGContextDrawImage(c, CGRectMake(0, 0, bgSubRect.size.width, bgSubRect.size.height), subimage);
                    
81	}
                    
                
gps.hxx git://pkgs.fedoraproject.org/FlightGear | C++ Header | 438 lines
                    
77 */
                    
78class GPS : public SGSubsystem, public flightgear::RNAV
                    
79{
                    
84
                    
85  // SGSubsystem interface
                    
86    virtual void init ();
                    
                
forums.lua http://facepunch-lua-sdk.googlecode.com/svn/trunk/ | Lua | 261 lines
                    
169
                    
170				-- need to specify base, otherwise it takes the second return value for gsub
                    
171				retForum.threadCount = tonumber( string.gsub( threadCount, ",", "" ), 10 )
                    
171				retForum.threadCount = tonumber( string.gsub( threadCount, ",", "" ), 10 )
                    
172				retForum.postCount = tonumber( string.gsub( postCount, ",", "" ), 10 )
                    
173
                    
174				retForum.forumName = forumName
                    
175				retForum.viewers = tonumber( string.gsub( viewers, ",", "" ), 10 )
                    
176				retForum.forumDescription = forumDescription
                    
253		thread.lastPostURL = lastPostURL
                    
254		thread.replyCount = tonumber( string.gsub( replies, ",", "" ), 10 )
                    
255		thread.viewCount = tonumber( string.gsub( views, ",", "" ), 10 )
                    
                
mathematics.py git://github.com/sublee/trueskill.git | Python | 260 lines
                    
8
                    
9   :copyright: (c) 2012-2016 by Heungsub Lee.
                    
10   :license: BSD, see LICENSE for more details.
                    
                
bili_ranking_image.rb http://bilibiliranking.googlecode.com/svn/trunk/ | Ruby | 208 lines
                    
126        work = Work.find_by_wid d.wid
                    
127        d_name = @@iconv.iconv(d.name).gsub(/\"/,'\\"')
                    
128        img = ImageList.new(pa + '3_list2\\_model.png') if e_i.zero?
                    
                
SequencesTest.java https://code.google.com/p/totallylazy/ | Java | 187 lines
                    
103    @Test
                    
104    public void supportsJoiningSubTypes() throws Exception {
                    
105        final Sequence<Number> numbers = numbers(2, 3.0D);
                    
                
z.sh git://github.com/dakrone/dakrone-dotfiles.git | Shell | 240 lines
                    
165                clean_short = short
                    
166                gsub(/[\(\)\[\]\|]/, "\\\\&", clean_short)
                    
167                for( x in matches ) if( matches[x] && x !~ clean_short ) return
                    
                
binutils-common.exp git://pkgs.fedoraproject.org/mingw-w64-tools | Expect | 316 lines
                    
245		foreach {name value} $ref_subst {
                    
246		    regsub -- $name $line_bx $value line_bx
                    
247		}
                    
284	    foreach {name value} $ref_subst {
                    
285		regsub -- $name $line_bx $value line_bx
                    
286	    }
                    
                
types.R git://github.com/duncantl/RLLVMCompile.git | R | 330 lines
                    
214          ty = as(md[[1]][[1]], "character")
                    
215          ty = gsub('[!"]', "", gsub("^metadata ", "", ty))   # the "metadata " is from LLVM 3.5
                    
216          return(get(ty, globalenv(), inherits = TRUE))
                    
                
llpanelsnapshotpostcard.cpp https://bitbucket.org/lindenlab/viewer-development/ | C++ | 271 lines
                    
68
                    
69	bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
                    
70	void sendPostcard();
                    
148
                    
149bool LLPanelSnapshotPostcard::missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response)
                    
150{
                    
263	{
                    
264		LLNotificationsUtil::add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLPanelSnapshotPostcard::missingSubjMsgAlertCallback, this, _1, _2));
                    
265		return;
                    
                
LibPeriodicTable-3.1.lua https://code.google.com/p/strongcwowinterface/ | Lua | 371 lines
                    
71		-- Escape characters that will screw up the name matching.
                    
72		local escapedparentname = parentname:gsub("([%.%(%)%%%+%-%*%?%[%]%^%$])", "%%%1")
                    
73		-- Check all the sets to see if they start with this name.
                    
                
ForceSFV.tcl http://nxscripts.googlecode.com/svn/ | TCL | 130 lines
                    
64proc ArgRange {list start end} {
                    
65	regsub -all {[\s]+} $list { } list
                    
66	return [join [lrange [split [string trim $list] { }] $start $end] { }]
                    
88proc SplitPath {path} {
                    
89    regsub -all -- {[\\/]+} $path {/} path
                    
90    return [file split [string trim $path "/"]]
                    
                
matheval.c git://pkgs.fedoraproject.org/libmatheval | C | 367 lines
                    
42#ifdef HAVE_SCM_MAKE_GSUBR
                    
43#define scm_c_define_gsubr scm_make_gsubr
                    
44#else
                    
44#else
                    
45#error Neither scm_c_define_gsubr() nor scm_make_gsubr() available
                    
46#endif
                    
78	/* Register other procedures working on evaluator type. */
                    
79	scm_c_define_gsubr("evaluator-create", 1, 0, 0,
                    
80			   (SCM(*)())evaluator_create_scm);
                    
80			   (SCM(*)())evaluator_create_scm);
                    
81	scm_c_define_gsubr("evaluator-evaluate", 4, 0, 0,
                    
82			   (SCM(*)())evaluator_evaluate_scm);
                    
82			   (SCM(*)())evaluator_evaluate_scm);
                    
83	scm_c_define_gsubr("evaluator-get-string", 1, 0, 0,
                    
84			   (SCM(*)())evaluator_get_string_scm);
                    
                
luaannotate.lua git://github.com/davidm/lua-annotate.git | Lua | 170 lines
                    
17      --print('DEBUG-luacomment-commit', id, text)
                    
18      text = text:gsub('[\r\n]$', '')
                    
19      annotations[id] = text
                    
118  scite_OnOpen(function(path)
                    
119    local annotations_path = path:gsub('[^\\/]+$', 'annotations.txt')
                    
120    print('DEBUG-luacomment-open', path, annotations_path)
                    
133local function cpp_escape_comment(text)
                    
134  text = text:gsub('%*/', '* /')
                    
135  return text
                    
147  local iline = 1
                    
148  code = (code .. '\n'):gsub('(.-\r?\n)', function(line)
                    
149    if commentofline[iline] then
                    
160if path then
                    
161  local annotations_path = path:gsub('[^\\/]+$', 'annotations.txt')
                    
162  local code = read_file(path)
                    
                
collection.rb git://github.com/stevenbristol/lovd-by-less.git | Ruby | 142 lines
                    
112      
                    
113      each_with_attribute method.to_s.gsub(/^each_with_/, ''), &block
                    
114    end
                    
                
LocalTerminalLaunchUtilities.java git://pkgs.fedoraproject.org/eclipse-rse | Java | 305 lines
                    
124		}
                    
125		String expandedLocation = getStringVariableManager().performStringSubstitution(location);
                    
126		if (expandedLocation == null || expandedLocation.length() == 0) {
                    
156			String expandedLocation;
                    
157			expandedLocation = getStringVariableManager().performStringSubstitution(location);
                    
158			if (expandedLocation.length() > 0) {
                    
185
                    
186			String expanded = getStringVariableManager().performStringSubstitution(arguments);
                    
187			return parseStringIntoList(expanded);
                    
                
CopyResources.lua http://angel-engine.googlecode.com/svn/trunk/ | Lua | 144 lines
                    
46
                    
47lfs.chdir(fulljoin(os.getenv('PROJECT_DIR'), '..', 'Angel', 'Scripting', 'EngineScripts'):gsub('"', ''))
                    
48
                    
81
                    
82if (not path.exists(dest:gsub('"', ''))) then
                    
83  makedirs(dest:gsub('"', ''))
                    
88    local dstname = fulljoin(dest, path.basename(filename))
                    
89    dir.copyfile(filename, dstname:gsub('"', ''))
                    
90  end
                    
                
swank.lua git://github.com/matsu911/swank-lua.git | Lua | 370 lines
                    
233   self.lua_command = (self.lua_command or "") .. '\n' .. args[1]
                    
234   self.lua_command = self.lua_command:gsub("^%s*", ""):gsub("%s*$", "")
                    
235   self.logger(self.lua_command:len(), self.lua_command)
                    
306   else
                    
307      return return_abort_message(double_quote(ret:gsub('"', '\\"')), serial), write_str
                    
308   end
                    
                
cheddargetter_spec.rb git://github.com/ads/cheddargetter.git | Ruby | 234 lines
                    
229  def mock_request(method, request_path, response_xml)
                    
230    request_path.gsub!(/^\//, '')
                    
231    options = { :body => response_xml, :content_type =>  "text/xml" }
                    
                
ui_text_field.rb git://github.com/clayallsopp/formotion.git | Ruby | 166 lines
                    
118    if BW::Device.ios_version >= "7.0"
                    
119      theTextField.text = theTextField.text.gsub("\u00a0", " ").strip
                    
120    end
                    
                
prosody_files.lua git://github.com/bjc/prosody.git | Lua | 143 lines
                    
25local function clean_path(path)
                    
26	return path:gsub("\\", "/"):gsub("//+", "/"):gsub("^~", os_getenv("HOME") or "~");
                    
27end
                    
29	local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });
                    
30	decode = function (s) return s and (s:gsub("+", " "):gsub("%%([a-fA-F0-9][a-fA-F0-9])", urlcodes)); end
                    
31	encode = function (s) return s and (s:gsub("%W", function (c) return format("%%%02x", c:byte()); end)); end
                    
33local function decode_dir(x)
                    
34	if x:gsub("%%%x%x", ""):gsub("[a-zA-Z0-9]", "") == "" then
                    
35		return decode(x);
                    
38local function decode_file(x)
                    
39	if x:match(".%.dat$") and x:gsub("%.dat$", ""):gsub("%%%x%x", ""):gsub("[a-zA-Z0-9]", "") == "" then
                    
40		return decode(x:gsub("%.dat$", ""));
                    
                
liberty-idsis-pp-v1.1.xsd git://pkgs.fedoraproject.org/axis | XML Schema | 261 lines
                    
201      <xs:element ref="MsgAccount" minOccurs="0"/>
                    
202      <xs:element ref="MsgSubaccount" minOccurs="0"/>
                    
203      <xs:element ref="Extension" minOccurs="0"/>
                    
219  <xs:element name="MsgAccount" type="DSTString"/>
                    
220  <xs:element name="MsgSubaccount" type="DSTString"/>
                    
221  <xs:element name="Facade" type="FacadeType"/>
                    
                
url.lua http://suckerserv.googlecode.com/svn/trunk/ | Lua | 298 lines
                    
28function escape(s)
                    
29    return string.gsub(s, "([^A-Za-z0-9_])", function(c)
                    
30        return string.format("%%%02x", string.byte(c))
                    
57local function protect_segment(s)
                    
58	return string.gsub(s, "([^A-Za-z0-9_])", function (c)
                    
59		if segment_set[c] then return c
                    
71function unescape(s)
                    
72    return string.gsub(s, "%%(%x%x)", function(hex)
                    
73        return string.char(base.tonumber(hex, 16))
                    
86    if string.sub(relative_path, 1, 1) == "/" then return relative_path end
                    
87    local path = string.gsub(base_path, "[^/]*$", "")
                    
88    path = path .. relative_path
                    
88    path = path .. relative_path
                    
89    path = string.gsub(path, "([^/]*%./)", function (s)
                    
90        if s ~= "./" then return s else return "" end
                    
                
bng.c git://github.com/thelema/ocaml-community.git | C | 435 lines
                    
145  for (/**/; blen > 0; blen--, a++, b++) {
                    
146    BngSub2Carry(*a, carry, *a, *b, carry);
                    
147  }
                    
243    /* current digit of a -= pl + out.  Accumulate carrys in ph. */
                    
244    BngSub3(*a, ph, *a, pl, out);
                    
245    /* prepare out for next iteration */
                    
249  /* current digit of a -= out */
                    
250  BngSub2(*a, carry, *a, out);
                    
251  a++;
                    
                
bib_profile https://code.google.com/p/koha/ | Perl | 128 lines
                    
68    my $result = shift;
                    
69    my $sth = $dbh->prepare_cached("SELECT tagfield, tagsubfield 
                    
70                                    FROM marc_subfield_structure 
                    
71                                    WHERE frameworkcode = '' 
                    
72                                    AND tagsubfield <> '\@' 
                    
73                                    AND kohafield <> 'biblioitems.itemtype'
                    
99    my $result = shift;
                    
100    my $sth = $dbh->prepare_cached("SELECT tagfield, tagsubfield
                    
101                                    FROM marc_subfield_structure 
                    
114    my $itemtypes = GetItemTypes;
                    
115    my $sth = $dbh->prepare_cached("SELECT tagfield, tagsubfield
                    
116                                    FROM marc_subfield_structure 
                    
                
EventAggregatorFixture.cs https://hg.codeplex.com/tecx | C# | 146 lines
                    
99
                    
100            CancelingSubscriber subscriber = new CancelingSubscriber();
                    
101
                    
                
validate.lua git://github.com/keplerproject/luarocks.git | Lua | 160 lines
                    
44local function prepare_sandbox(file)
                    
45   local root_dir = fs.make_temp_dir(file):gsub("/+$", "")
                    
46   cfg.root_dir = root_dir
                    
                
index.go git://github.com/tav/go.git | Go | 225 lines
                    
144		// Direct value, fetch from struct, fetch from struct pointer.
                    
145		// The last two cases get us to oindex_const_sudo in gsubr.c.
                    
146		[]string{"", "t.", "pt."},
                    
151		// Element is int, element is quad (struct).
                    
152		// This controls whether we end up in gsubr.c (i) or cgen.c (q).
                    
153		[]string{"i", "q"},
                    
                
Globals.h https://code.google.com/p/tortoisegit/ | C Header | 124 lines
                    
50#define MENUSVNIGNORE	    0x0000000040000000
                    
51#define MENULOGSUBMODULE	0x0000000100000000
                    
52#define MENUPREVDIFF		0x0000000200000000
                    
                
build_with_mtasc.rb git://github.com/textmate/actionscript.tmbundle.git | Ruby | 162 lines
                    
56      @size_is_percentage = true
                    
57      @config['width'].gsub!(/%/,'')
                    
58      @config['height'].gsub!(/%/,'')
                    
                
override.properties git://pkgs.fedoraproject.org/thunderbird-lightning | Properties File | 119 lines
                    
82UninstallingText=??????? $BrandFullNameDA ????????????? $_CLICK
                    
83UninstallingSubText=??????????????:
                    
84FileError=?????????: \r\n\r\n$0\r\n\r\n????????????? “??” ????????????\r\n?????? “???” ????????????\r\n??????????????? “??” ????????????
                    
                
cache.rb git://github.com/wagn/wagn.git | Ruby | 177 lines
                    
8      n = 0 if n.nil?
                    
9      sprintf("%s%d-%d%s", basename.to_s.gsub(/\.\w+$/) { |s| ext = s; '' }, $$, n, ext)
                    
10    end
                    
16    def real_file_path(name)
                    
17      name = name.gsub('%','%25').gsub('?','%3F').gsub(':','%3A')
                    
18      name = name.gsub('\\','%5C').gsub('*','%2A').gsub('"','%22')
                    
18      name = name.gsub('\\','%5C').gsub('*','%2A').gsub('"','%22')
                    
19      name = name.gsub('<','%3C').gsub('>','%3E').gsub('|','%7C')
                    
20      '%s/%s.cache' % [@cache_path, name ]
                    
                
rjmethod.rb git://github.com/koichiro/rava.git | Ruby | 227 lines
                    
199    # native 探し
                    
200    nm  = 'RJN_' + @owner.this_class.gsub('/','_')
                    
201    begin
                    
                
presenter.rb git://github.com/DigitPaint/skyline.git | Ruby | 122 lines
                    
112        else
                    
113          truncate(simple_format(strip_tags(content.gsub("<br />", "<br />\n").gsub("</p>", "</p>\n"))), :length => 150)
                    
114        end
                    
                
GMdi.cpp https://lgi.svn.sourceforge.net/svnroot/lgi | C++ | 682 lines
                    
296					PointToScreen(p);
                    
297					GSubMenu *Sub = new GSubMenu;
                    
298					if (Sub)
                    
                
musmap.tcl http://egghelp.googlecode.com/svn/trunk/ | TCL | 342 lines
                    
146	proc tolow {strr} {return [string tolower [string map {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} $strr]]}
                    
147	proc sspace {strr} {return [string trim [regsub -all {[\t\s]+} $strr { }]]}
                    
148	proc chkrusl {symb} {if {[lsearch -exact {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} $symb] > -1} {return 1} {return 0}}
                    
208#----------------------------------------------------------------------------
                    
209		regsub -all -- "\n|\r" $str {} str
                    
210
                    
211	if {[regexp {gnodMapSettings.*?</script>(.*?)<script>} $str -> res]} {
                    
212		regsub -all -- "<a href.*?>" $res " \002*\002 " res
                    
213		regsub -all -- "<.*?>" $res {} res
                    
279		foreach {parser extra redir} $reqqueue($id) {break}
                    
280		regsub -- "^$token," $id {} id
                    
281	
                    
                
ds_system.lua http://microlua-sim.googlecode.com/svn/trunk/ | Lua | 250 lines
                    
55    local dir = ( Sys.convertFakeRootToRoot(wx.wxGetCwd().."/") )
                    
56    return dir:gsub("//", "/")
                    
57end
                    
                
typechecker_test.go git://github.com/ssrl/go.git | Go | 168 lines
                    
80			case token.COMMENT:
                    
81				s := errRx.FindStringSubmatch(lit)
                    
82				if len(s) == 2 {
                    
                
ruby_less_processing.rb git://github.com/zena/zena.git | Ruby | 314 lines
                    
65      # def r_erb
                    
66      #   "<pre><%= @erb.gsub('<','&lt;').gsub('>','&gt;') %></pre>"
                    
67      # end
                    
                
json.lib.lua https://code.google.com/p/prosody-modules/ | Lua | 355 lines
                    
46	-- FIXME do proper utf-8 and binary data detection
                    
47	t_insert(buffer, "\""..(o:gsub(".", escapes)).."\"");
                    
48end
                    
                
crontab.rb http://ruby-hive.googlecode.com/svn/trunk/ | Ruby | 368 lines
                    
206
                    
207    day_of_week = day_of_week.downcase.gsub(/#{WDAY.join("|")}/){
                    
208      WDAY.index($&)
                    
225
                    
226    day_of_week = day_of_week.downcase.gsub(/#{WDAY.join("|")}/){
                    
227      WDAY.index($&)
                    
                
Dump.lua git://github.com/tekkub/wow-ui-source.git | Lua | 408 lines
                    
54local string_sub = string.sub;
                    
55local string_gsub = string.gsub;
                    
56local string_format = string.format;
                    
80            val = string_sub(val, 1, DEVTOOLS_LONG_STRING_CUTOFF);
                    
81            return string_gsub(string_format("%q...+%s",val,more),"[|]", "||");
                    
82        else
                    
82        else
                    
83            return string_gsub(string_format("%q",val),"[|]", "||");
                    
84        end
                    
                
VT100TextStorage.m git://github.com/kkass/iterm.git | Objective C | 167 lines
                    
87    {
                    
88	NSString *origSubstring, *commonString;
                    
89
                    
90	// strip out the common stuff
                    
91	origSubstring = [[contents attributedSubstringFromRange: range] string];
                    
92	commonString = [origSubstring commonPrefixWithString: str options: NSLiteralSearch];
                    
98
                    
99	    if([commonString isEqualToString: origSubstring])
                    
100		origDiffString = @"";
                    
101	    else
                    
102		origDiffString = [origSubstring substringFromIndex: [commonString length]];
                    
103
                    
                
Rakefile git://github.com/eahanson/Expectacular.git | Rakefile | 100 lines
                    
94            rendered = ERB.new(IO.read("Templates/Expect.erb.#{extension}")).result(binding)
                    
95            rendered.gsub! /^\s+$/, ""          # remove whitespace from otherwise-empty lines
                    
96            rendered.gsub! /\n{3,}/, "\n\n\n"   # remove multiple contiguous blank lines
                    
                
util.js git://github.com/caolan/jam.git | JavaScript | 137 lines
                    
46    //
                    
47    //     "hello".gsub /[aeiou]/, '*'      #=> "h*ll*"
                    
48    //     "hello".gsub /[aeiou]/, '<$1>'   #=> "h<e>ll<o>"
                    
48    //     "hello".gsub /[aeiou]/, '<$1>'   #=> "h<e>ll<o>"
                    
49    //     "hello".gsub /[aeiou]/, ($) {
                    
50    //       "<#{$[1]}>"                    #=> "h<e>ll<o>"
                    
51    //
                    
52    gsub: function (str, pattern, replacement) {
                    
53      var i, match, matchCmpr, matchCmprPrev, replacementStr, result, self;
                    
73              if (matchCmpr[i]) {
                    
74                replacementStr = u.string.gsub(replacementStr, new RegExp("\\\$" + i), matchCmpr[i]);
                    
75              }
                    
93    upcase: function(str) {
                    
94      var self = u.string.gsub(str, /_([a-z])/, function ($) {
                    
95        return "_" + $[1].toUpperCase();
                    
                
encodings.rb git://github.com/IronLanguages/main.git | Ruby | 269 lines
                    
49    def Encodings.get_name(enc)
                    
50      enc = enc.to_s.gsub("-", "_").downcase
                    
51    end
                    
118      
                    
119      str = str.gsub(/\?=(\s*)=\?/, '?==?') # Remove whitespaces between 'encoded-word's
                    
120
                    
126          # Join QP encoded-words that are adjacent to avoid decoding partial chars
                    
127          text.gsub!(/\?\=\=\?.+?\?[Qq]\?/m, '') if text =~ /\?==\?/
                    
128        
                    
129          # Separate encoded-words with a space, so we can treat them one by one
                    
130          text.gsub!(/\?\=\=\?/, '?= =?')
                    
131
                    
151
                    
152      if original_encoding.to_s.downcase.gsub("-", "") == to_encoding.to_s.downcase.gsub("-", "")
                    
153        output
                    
                
sfnt.h git://pkgs.fedoraproject.org/firebird | C Header | 214 lines
                    
36
                    
37struct CMAPEncodingSubtableHeader
                    
38{
                    
47    le_uint16   numberSubtables;
                    
48    CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
                    
49};
                    
50
                    
51struct CMAPEncodingSubtable
                    
52{
                    
57
                    
58struct CMAPFormat0Encoding : CMAPEncodingSubtable
                    
59{
                    
70
                    
71struct CMAPFormat2Encoding : CMAPEncodingSubtable
                    
72{
                    
                
my_space_controller.rb http://mushplatform.googlecode.com/svn/trunk/ | Ruby | 300 lines
                    
79    unless current_theme.is_sns_theme?
                    
80      render_liquid({:template => 'entry',:layout => true},{'entry' => @blog,'if_login' => current_user,'comments' => @comments ,'will_paginate_options' => {'prev_label' => '???','next_label' => '???',:page => params[:page]||1,:path => "#{request.path.gsub(/\/comments\/page\/\d+/,'')}/comments"}})
                    
81    else
                    
239    orignal_params['page'] = params[:page] || 1
                    
240    orignal_params[:path]  = request.path.gsub(/\/page\/\d+/,'')
                    
241    orignal_params
                    
                
DnsSinkCodingSubcoding.cs https://PcapDotNet.svn.codeplex.com/svn | C# | 280 lines
                    
5    /// </summary>
                    
6    public enum DnsSinkCodingSubCoding : ushort
                    
7    {
                    
                
AbstractTag.java git://github.com/tulskiy/musique.git | Java | 421 lines
                    
201
                    
202    public int getFieldCountIncludingSubValues() {
                    
203        return getFieldCount();
                    
                
Common.lua http://deku2d-engine.googlecode.com/svn/trunk/ | Lua | 358 lines
                    
38-- The thing below is very stupid, so it doesn't any lexical analisys
                    
39-- just simple plaint text iterative gsub
                    
40Preprocessor = Preprocessor or 
                    
70    for i = 1, #args do
                    
71      substRes = substRes:gsub( info.templates[ i ], args[ i ] )
                    
72    end
                    
                
furnish_corridor.lua http://corsix-th.googlecode.com/svn/trunk/ | Lua | 231 lines
                    
47  self.title_text = _S.buy_objects_window.choose_items
                    
48  self.price_text = (_S.buy_objects_window.price .. " "):gsub("  $", " ")
                    
49  self.total_text = (_S.buy_objects_window.total .. " "):gsub("  $", " ")
                    
                
handler.rb https://code.google.com/p/beef/ | Ruby | 296 lines
                    
53          elsif (not @data['request'].referer.nil?) and (not @data['request'].referer.empty?)
                    
54            log_zombie_domain=@data['request'].referer.gsub('http://', '').gsub('https://', '').split('/')[0]
                    
55          else
                    
                
TestCACT.java http://hypergraphdb.googlecode.com/svn/trunk/ | Java | 348 lines
                    
23import org.hypergraphdb.HyperNode;
                    
24import org.hypergraphdb.atom.HGSubsumes;
                    
25import org.hypergraphdb.peer.HyperGraphPeer;
                    
206            HGQueryCondition expression = hg.dfs(graph1.getTypeSystem().getTop(), 
                    
207                                               hg.type(HGSubsumes.class), null, false, true); 
                    
208            RemoteQueryExecution<HGHandle> activity = 
                    
233            HGQueryCondition expression = hg.dfs(graph1.getTypeSystem().getTop(), 
                    
234                                               hg.type(HGSubsumes.class), null, false, true); 
                    
235            RunRemoteQuery activity = 
                    
                
be.rb git://github.com/robbyrussell/rubyurl.git | Ruby | 224 lines
                    
169        def split_words(sym)
                    
170          sym.to_s.gsub(/_/,' ')
                    
171        end
                    
                
Bouncer.py https://mailman.svn.sourceforge.net/svnroot/mailman | Python | 332 lines
                    
10import time
                    
11import regsub, string, regex
                    
12import mm_utils, mm_cfg, mm_err
                    
226	if mime_info:
                    
227	    mime_info_parts = regsub.splitx(
                    
228                mime_info, '[Bb][Oo][Uu][Nn][Dd][Aa][Rr][Yy]="[^"]+"')
                    
229	    if len(mime_info_parts) > 1:
                    
230		boundry = regsub.splitx(mime_info_parts[1],
                    
231                                        '"[^"]+"')[1][1:-1]
                    
236	    # This looks strange, but at least 2 are going to be no-ops.
                    
237	    relevant_text = regsub.split(msg.body,
                    
238                                         '^.*Message header follows.*$')[0]
                    
238                                         '^.*Message header follows.*$')[0]
                    
239	    relevant_text = regsub.split(relevant_text,
                    
240                                         '^The text you sent follows:.*$')[0]
                    
                
ViewPMActivity.java http://sofurry-android-app.googlecode.com/svn/trunk/ | Java | 301 lines
                    
46    private String        msgDate_;
                    
47    private String        msgSubject_;
                    
48    private TextView      messageText_;
                    
138            msgDate_      = (String) retrieveObject("msgDate");
                    
139            msgSubject_   = (String) retrieveObject("msgSubject");
                    
140            pmId_         = (Integer) retrieveObject("pmId");
                    
172            // Retrieve the data we need to use later
                    
173            msgSubject_   = jsonItem.getString("subject");
                    
174            fromUserId_   = jsonItem.getString("fromUserId");
                    
178            // Generate and show contents
                    
179            content_ = formatContents(jsonItem.getString("message"), fromUserName_, msgSubject_, msgDate_);
                    
180
                    
281        storeObject("msgDate", msgDate_);
                    
282        storeObject("msgSubject", msgSubject_);
                    
283        storeObject("pmId", (Integer) pmId_);
                    
                
db_browser.rb http://luapack.googlecode.com/svn/trunk/ | Ruby | 212 lines
                    
134def e_js(str)
                    
135  str.to_s.gsub(/(?=['\\])/, '\\')
                    
136end
                    
148    full_content = escape(content)
                    
149    content = escape(content).gsub("\n", "<br>")
                    
150    if content.length > 30
                    
                
WindowsUtils.tcl git://pkgs.fedoraproject.org/coccinella | TCL | 416 lines
                    
50    if {[info exists ProgramFiles]} {
                    
51	regsub -nocase "%programfiles%" $appCmd $ProgramFiles appCmd
                    
52    }
                    
52    }
                    
53    regsub -all {\\} $appCmd  {\\\\} appCmd
                    
54    
                    
88    # Double up the backslashes for eval (below)
                    
89    regsub -all {\\} $appCmd  {\\\\} appCmd
                    
90    if {[info exists ProgramFiles]} {
                    
90    if {[info exists ProgramFiles]} {
                    
91	regsub -nocase "%programfiles%" $appCmd $ProgramFiles appCmd
                    
92    }
                    
135    # Double up the backslashes for eval (below)
                    
136    regsub -all {\\} $appCmd  {\\\\} appCmd
                    
137    regsub {%1} $appCmd $path appCmd
                    
                
QuantifiedExpression.java git://pkgs.fedoraproject.org/saxon | Java | 320 lines
                    
165
                    
166    public void checkForUpdatingSubexpressions() throws XPathException {
                    
167        sequence.checkForUpdatingSubexpressions();
                    
167        sequence.checkForUpdatingSubexpressions();
                    
168        action.checkForUpdatingSubexpressions();
                    
169    }
                    
207
                    
208    public boolean hasLoopingSubexpression(Expression child) {
                    
209        return child == action;
                    
                
mailbox.py git://pkgs.fedoraproject.org/openchange | Python | 289 lines
                    
90                      "PidTagLastModificationTime": "%d" % self.nttime,
                    
91                      "PidTagSubFolders": str(childcount != 0).upper(),
                    
92                      "PidTagFolderChildCount": str(childcount),
                    
108                      "PidTagContainerClass": "IPF.Note (check this)",
                    
109                      "PidTagSubFolders": str(childcount != 0).upper(),
                    
110                      "PidTagFolderChildCount": str(childcount),
                    
                
ldAout.tcl git://pkgs.fedoraproject.org/tkimg | TCL | 241 lines
                    
217    set ldCommand "ar cr $outputFile"
                    
218    regsub { -o} $tail {} tail
                    
219  } else {
                    
                
mike-gcc.exp svn://gcc.gnu.org/svn/gcc/trunk/ | Expect | 0 lines
                    
169    # remove any leftover CRs.
                    
170    regsub -all -- "\r" $comp_output "" comp_output
                    
171
                    
171
                    
172    regsub -all "(^|\n)\[^\n\]*linker input file unused since linking not done" $comp_output "" comp_output
                    
173    regsub -all "(^|\n)\[^\n\]*file path prefix \[^\n\]* never used" $comp_output "" comp_output
                    
                
bbquePlatformLayoutParser.awk https://bitbucket.org/bosp/barbeque.git | AWK | 162 lines
                    
63	# Parsing HOST configuration
                    
64	gsub(/[[:space:]]*/,"", $2); BBQUE_HOST_CPUS = $2
                    
65	gsub(/[[:space:]]*/,"", $3); BBQUE_HOST_MEMS = $3
                    
93	# Parsing MDEV configuration
                    
94	gsub(/[[:space:]]*/,"", $2); BBQUE_MDEV_CPUS = $2
                    
95	gsub(/[[:space:]]*/,"", $3); BBQUE_MDEV_MEMS = $3
                    
123	# Parsing NODE configuration
                    
124	gsub(/[[:space:]]*/,"", $2); BBQUE_NODE_CPUS =  $2
                    
125	gsub(/[[:space:]]*/,"", $3); BBQUE_NODE_CPUQ = ($3*1000)
                    
125	gsub(/[[:space:]]*/,"", $3); BBQUE_NODE_CPUQ = ($3*1000)
                    
126	gsub(/[[:space:]]*/,"", $4); BBQUE_NODE_MEMS =  $4
                    
127	gsub(/[[:space:]]*/,"", $5); BBQUE_NODE_MEMB = ($5*1048576)
                    
                
DatePicker.m http://baohebao.googlecode.com/svn/trunk/ | Objective C | 142 lines
                    
84        btnDate.frame=CGRectMake(0, 0, 80, 30);
                    
85        [self bringSubviewToFront:btnDate];
                    
86        [btnDate.titleLabel setFont:[UIFont systemFontOfSize:14]]; 
                    
                
reference.hiccup.clj git://github.com/slagyr/joodoweb.git | Clojure | 182 lines
                    
135    [joodo.views :only (render-partial *view-context*)]
                    
136    [joodo.string :only (gsub)]
                    
137    [joodo.datetime :only (parse-datetime)]
                    
146(defn get-post-name [post-file-name]
                    
147  (gsub
                    
148    (second (post-parts post-file-name))
                    
                
playground.rb git://github.com/assaf/vanity.git | Ruby | 262 lines
                    
180    def experiment(name)
                    
181      id = name.to_s.downcase.gsub(/\W/, "_").to_sym
                    
182      Vanity.logger.warn("Deprecated: Please call experiment method with experiment identifier (a Ruby symbol)") unless id == name
                    
                
css_parser.rb http://ruby-css-parser.googlecode.com/svn/trunk/ | Ruby | 149 lines
                    
135
                    
136    out = css.gsub(URI_RX) do |s|
                    
137      uri = $1.to_s
                    
137      uri = $1.to_s
                    
138      uri.gsub!(/["']+/, '')
                    
139      # Don't process URLs that are already absolute
                    
                
bcsave.lua git://git.savannah.nongnu.org/gsl-shell.git | Lua | 497 lines
                    
85  check(string.match(str, "^[%w_.%-]+$"), "bad module name")
                    
86  return string.gsub(str, "[%.%-]", "_")
                    
87end
                    
99  check(str, "cannot derive module name, use -n name")
                    
100  return string.gsub(str, "[%.%-]", "_")
                    
101end
                    
                
test_rdoc_text.rb git://github.com/ruby/ruby.git | Ruby | 575 lines
                    
115  def test_markup_string
                    
116    out = markup('hi').gsub("\n", '')
                    
117
                    
121  def test_markup_comment
                    
122    out = markup(comment('hi')).gsub("\n", '')
                    
123
                    
                
test_ssl_session.rb git://github.com/ruby/ruby.git | Ruby | 400 lines
                    
25        assert_match(/-----END SSL SESSION PARAMETERS-----\Z/, pem)
                    
26        pem.gsub!(/-----(BEGIN|END) SSL SESSION PARAMETERS-----/, '').gsub!(/[\r\n]+/m, '')
                    
27        assert_equal(session.to_der, pem.unpack('m*')[0])
                    
                
dmxparse.h git://anongit.freedesktop.org/git/xorg/xserver.git/ | C Header | 0 lines
                    
175    struct _DMXConfigSub      *next;
                    
176} DMXConfigSub, *DMXConfigSubPtr;
                    
177
                    
270                                              DMXConfigParamPtr param);
                    
271extern void                dmxConfigFreeSub(DMXConfigSubPtr sub);
                    
272extern DMXConfigSubPtr     dmxConfigSubComment(DMXConfigCommentPtr comment);
                    
272extern DMXConfigSubPtr     dmxConfigSubComment(DMXConfigCommentPtr comment);
                    
273extern DMXConfigSubPtr     dmxConfigSubDisplay(DMXConfigDisplayPtr display);
                    
274extern DMXConfigSubPtr     dmxConfigSubWall(DMXConfigWallPtr wall);
                    
274extern DMXConfigSubPtr     dmxConfigSubWall(DMXConfigWallPtr wall);
                    
275extern DMXConfigSubPtr     dmxConfigSubOption(DMXConfigOptionPtr option);
                    
276extern DMXConfigSubPtr     dmxConfigSubParam(DMXConfigParamPtr param);
                    
276extern DMXConfigSubPtr     dmxConfigSubParam(DMXConfigParamPtr param);
                    
277extern DMXConfigSubPtr     dmxConfigAddSub(DMXConfigSubPtr head,
                    
278                                           DMXConfigSubPtr sub);
                    
                
gendoc.lua git://github.com/zhuomingliang/luatcc.git | Lua | 307 lines
                    
70	chapterid = chapterid+1
                    
71	local text = text:gsub("%%chapterid%%", tostring(chapterid))
                    
72	if not raw then
                    
76		for _,section in ipairs(sections) do
                    
77			section = section:gsub("%%chapterid%%", tostring(chapterid))
                    
78			text = text..[[
                    
                
thunderdownloader.cpp https://bitbucket.org/knoss/pcmanager/ | C++ | 347 lines
                    
32	sss.hRegRootKey          = HKEY_LOCAL_MACHINE;
                    
33	sss.pszRegSubKey         = TEXT( "SOFTWARE\\Thunder Network\\ThunderOem\\thunder_backwnd" );
                    
34	sss.pszPathValue      	 = TEXT( "Path" );
                    
                
parser_test.rb git://github.com/jlong/radius.git | Ruby | 323 lines
                    
105    define_tag("nesting") { |tag| tag.nesting }
                    
106    define_tag("extra:nesting") { |tag| tag.nesting.gsub(':', ' > ') }
                    
107    define_tag("parent:child:nesting") { |tag| tag.nesting.gsub(':', ' * ') }
                    
                
__init.lua git://github.com/libcoral/coral.git | Lua | 178 lines
                    
33		-- filter the text, escaping common words that could be turned into links
                    
34		text = text:gsub( "(%p?[%w]+)", wordFilter )
                    
35
                    
                
Rakefile git://github.com/atduskgreg/rad.git | Rakefile | 142 lines
                    
90PATH    = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
                    
91hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
                    
92
                    
95  Dir['website/**/*.txt'].each do |txt|
                    
96    sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
                    
97  end
                    
                
Test05.java git://pkgs.fedoraproject.org/libreoffice | Java | 300 lines
                    
79            // open a new substream, set "MediaType" and "Compressed" properties to it and write some bytes
                    
80            if ( !m_aTestHelper.WriteBytesToSubstream( xSubSubStorage, "BigSubStream1", "MediaType1", true, pBigBytes ) )
                    
81                return false;
                    
140            XStream xBigSubStream1 = m_aTestHelper.OpenStream( xSubSubStorage,
                    
141                                                               "BigSubStream1",
                    
142                                                               ElementModes.WRITE | ElementModes.NOCREATE );
                    
145                                                            ElementModes.READ | ElementModes.NOCREATE );
                    
146            XStream xBigSubStream2 = m_aTestHelper.OpenStream( xSubSubStorage,
                    
147                                                               "BigSubStream2",
                    
149
                    
150            if ( xSubStream1 == null || xBigSubStream1 == null || xSubStream2 == null || xBigSubStream2 == null )
                    
151                return false;
                    
157            XStream xBigSubStream2clone = m_aTestHelper.OpenStream( xSubSubStorage,
                    
158                                                                    "BigSubStream2",
                    
159                                                                    ElementModes.READ | ElementModes.NOCREATE );
                    
                
OpenType.mli https://code.google.com/p/kompostilo/ | OCaml | 194 lines
                    
85
                    
86      (* GSUB *)
                    
87  | SingleSubstitutionLookup
                    
109    | PairAdjustmentSubtable of (value_record option * value_record option) GIDMap.t GIDMap.t
                    
110    | ClassBasedKerningSubtable of (int * int GIDMap.t * int GIDMap.t * int array)
                    
111
                    
141
                    
142type gsub_or_gpos = {
                    
143  langSysTable    : langsys_table;
                    
160  type t (* with sexp *)
                    
161  val make_gsub : FFfont.t -> Tag.t -> Tag.t -> t
                    
162  val make_gpos : FFfont.t -> Tag.t -> Tag.t -> t
                    
162  val make_gpos : FFfont.t -> Tag.t -> Tag.t -> t
                    
163  val make_from_table : gsub_or_gpos option -> t
                    
164  val dummy     : t
                    
                
facebook_form_builder.rb git://github.com/timothyf/EngineY.git | Ruby | 141 lines
                    
132        def sanitized_object_name
                    
133          @object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
                    
134        end
                    
                
Summons.lua git://github.com/tekkub/controlfreak.git | Lua | 130 lines
                    
122
                    
123	if type(lowvalue) == "string" then slider:SetMinMaxValues(tonumber((lowvalue:gsub("%%", "")))/100, tonumber((highvalue:gsub("%%", "")))/100)
                    
124	else slider:SetMinMaxValues(lowvalue, highvalue) end
                    
                
template_resolver.rb http://asproject.googlecode.com/svn/trunk/ | Ruby | 218 lines
                    
119
                    
120      relative = file.gsub(Dir.pwd, '')
                    
121      msg = <<EOF
                    
165    def clean_file_name name
                    
166      return name.gsub(@@ASPROJECT_FILE_NAME, project_name)
                    
167    end
                    
                
Utils.py https://mailman.svn.sourceforge.net/svnroot/mailman | Python | 408 lines
                    
27
                    
28import sys, string, fcntl, os, random, regsub, re
                    
29import mm_cfg
                    
232def QuoteHyperChars(str):
                    
233    arr = regsub.splitx(str, '[<>"&]')
                    
234    i = 1
                    
                
defs-nis.c git://pkgs.fedoraproject.org/slapi-nis | C | 364 lines
                    
53	 "%{uid}", NULL,
                    
54	 "%{uid}:%regsubi(\"%{userPassword}\",\"^\\\\{CRYPT\\\\}(..*)\",\"%1\",\"*\"):%regmatch(\"%{uidNumber}\",\"[0-9]+\"):%regmatch(\"%{gidNumber}\",\"[0-9]+\"):%{gecos:-%{cn:-}}:%{homeDirectory:-/}:%{loginShell:-" _PATH_BSHELL "}", NULL,
                    
55	 ":\r\n"},
                    
58	 "%{uidNumber}", NULL,
                    
59	 "%{uid}:%regsubi(\"%{userPassword}\",\"^\\\\{CRYPT\\\\}(..*)\",\"%1\",\"*\"):%regmatch(\"%{uidNumber}\",\"[0-9]+\"):%regmatch(\"%{gidNumber}\",\"[0-9]+\"):%{gecos:-%{cn:-}}:%{homeDirectory:-/}:%{loginShell:-" _PATH_BSHELL "}", NULL,
                    
60	 ":\r\n"},
                    
63	 "%{cn}", NULL,
                    
64	 "%{cn}:%regsubi(\"%{userPassword}\",\"^\\\\{CRYPT\\\\}(..*)\",\"%1\",\"*\"):%regmatch(\"%{gidNumber}\",\"[0-9]+\"):%merge(\",\",\"%{memberUid}\",\"%deref_r(\\\"member\\\",\\\"uid\\\")\",\"%deref_r(\\\"uniqueMember\\\",\\\"uid\\\")\")", NULL,
                    
65	 ":,\r\n"},
                    
68	 "%{gidNumber}", NULL,
                    
69	 "%{cn}:%regsubi(\"%{userPassword}\",\"^\\\\{CRYPT\\\\}(..*)\",\"%1\",\"*\"):%{gidNumber}:%merge(\",\",\"%{memberUid}\",\"%deref_r(\\\"member\\\",\\\"uid\\\")\",\"%deref_r(\\\"uniqueMember\\\",\\\"uid\\\")\")", NULL,
                    
70	 ":,\r\n"},
                    
84	 NULL,
                    
85	 "%mregsub(\"%{macaddress} %{cn}\",\"(..:..:..:..:..:..) (.*)\",\"%2\")",
                    
86	 NULL,
                    
                
Mime.tcl http://wub.googlecode.com/svn/trunk/ | TCL | 208 lines
                    
53	    }
                    
54	    regsub {[\t ]+} $line " " line
                    
55	    set line [split $line]
                    
                
1_normalmapping.lua http://zero-k.googlecode.com/svn/trunk/ | Lua | 137 lines
                    
38  if (VFS.FileExists(tex1)) then
                    
39    local basefilename = tex1:gsub("%....","")
                    
40    if (tonumber(basefilename:sub(-1,-1))) then
                    
52  if (not normaltex) and tex2 and (VFS.FileExists(tex2)) then
                    
53    local basefilename = tex2:gsub("%....","")
                    
54    if (tonumber(basefilename:sub(-1,-1))) then
                    
                
Rakefile git://github.com/shoes/shoes.git | Rakefile | 495 lines
                    
21RELEASE_ID, RELEASE_NAME = APP['version'], APP['release']
                    
22NAME = APP['shortname'] || APP['name'].downcase.gsub(/\W+/, '')
                    
23SONAME = 'shoes'
                    
164def skel_replace(line)
                    
165  line.gsub! /\s+%DEFAULTS%/ do
                    
166    if APPARGS
                    
180  Dir["bin/*.skel"].each do |src|
                    
181    name = src.gsub(/\.skel$/, '.c')
                    
182    File.open(src) do |skel|
                    
231      b.each do |line|
                    
232        a << line.gsub(reg) do
                    
233          if reg2.include? '\1'
                    
233          if reg2.include? '\1'
                    
234            reg2.gsub(%r!\\1!, Object.const_get($1))
                    
235          else
                    
                
parse.lua git://github.com/stevedonovan/LDoc.git | Lua | 440 lines
                    
65      if tag:match '^[%?!]' then
                    
66         tag = tag:gsub('^!','')
                    
67         value = tag .. ' ' .. value
                    
                
help.lua git://github.com/keplerproject/luarocks.git | Lua | 119 lines
                    
97   else
                    
98      command = command:gsub("-", "_")
                    
99      local cmd = commands[command] and require(commands[command])
                    
107         print_section("DESCRIPTION")
                    
108         util.printout("",(cmd.help:gsub("\n","\n\t"):gsub("\n\t$","")))
                    
109         print_section("SEE ALSO")
                    
                
HgSubscriberMergeContext.java git://pkgs.fedoraproject.org/eclipse-mercurial | Java | 150 lines
                    
35 */
                    
36public class HgSubscriberMergeContext extends SubscriberMergeContext {
                    
37
                    
40
                    
41	public HgSubscriberMergeContext(Subscriber subscriber,
                    
42			ISynchronizationScopeManager manager) {
                    
                
common_string.c git://pkgs.fedoraproject.org/scotch | C | 110 lines
                    
66void
                    
67stringSubst2 (
                    
68char * const                bsrcptr,
                    
84  if (pattptr != NULL)                            /* If remaining part of string has to be processed */
                    
85    stringSubst2 (pattptr + pattsiz, bdstptr + pattidx + replsiz, pattstr, replstr, pattsiz, replsiz);
                    
86
                    
96void
                    
97stringSubst (
                    
98char * const                buffptr,              /* String to search into */
                    
107
                    
108  stringSubst2 (buffptr, buffptr, pattstr, replstr, pattsiz, replsiz);
                    
109}
                    
                
gsubr.c git://git.savannah.gnu.org/guile.git | C | 342 lines
                    
27#include "libguile/_scm.h"
                    
28#include "libguile/gsubr.h"
                    
29#include "libguile/foreign.h"
                    
36/*
                    
37 * gsubr.c
                    
38 * Provide `gsubrs' -- subrs taking a prescribed number of required, optional,
                    
297SCM
                    
298scm_c_make_gsubr (const char *name, int req, int opt, int rst, SCM (*fcn)())
                    
299{
                    
303SCM
                    
304scm_c_define_gsubr (const char *name, int req, int opt, int rst, SCM (*fcn)())
                    
305{
                    
309SCM
                    
310scm_c_make_gsubr_with_generic (const char *name,
                    
311			       int req,
                    
                
string_ext.lua git://github.com/rrthomas/lua-stdlib.git | Lua | 300 lines
                    
67function caps (s)
                    
68  return (gsub (s, "(%w)([%w]*)",
                    
69                function (l, ls)
                    
77function chomp (s)
                    
78  return (gsub (s, "\n$", ""))
                    
79end
                    
85function escapePattern (s)
                    
86  return (gsub (s, "(%W)", "%%%1"))
                    
87end
                    
94function escapeShell (s)
                    
95  return (gsub (s, "([ %(%)%\\%[%]\"'])", "\\%1"))
                    
96end
                    
231
                    
232--- Perform multiple calls to gsub.
                    
233-- @param s string to call gsub on
                    
                
manageable.rb git://pkgs.fedoraproject.org/ruby-spqr | Ruby | 364 lines
                    
54    def declare_basic(what, name, kind, options)
                    
55      what_plural = "#{what.to_s.gsub(/y$/, 'ie')}s"
                    
56      w_get = what_plural.to_sym
                    
                
tpic2pdftex git://pkgs.fedoraproject.org/texlive | Shell | 408 lines
                    
74function qprintf(a) {
                    
75  gsub(/0* /," ", a);   # trailing zeroes in %f
                    
76  gsub(/\. /," ", a);   # orphaned decimal dots
                    
76  gsub(/\. /," ", a);   # orphaned decimal dots
                    
77  gsub(/0*]/,"]", a);   # trailing zeroes in brackets
                    
78  gsub(/0X/,"0", a);    # guard integer zeroes
                    
78  gsub(/0X/,"0", a);    # guard integer zeroes
                    
79  gsub(/-0 /,"0 ", a);  # correct -0 to 0
                    
80  print a;
                    
167/^  *\\special{pn/ {
                    
168  gsub(/[{}]/, " ");
                    
169  linethickness = $3 + 0;
                    
176/^  *\\special{pa/ {
                    
177  gsub(/[{}]/, " ");
                    
178  x[pointbuf] = $3 + 0;
                    
                
xep227toprosody.lua git://github.com/bjc/prosody.git | Lua | 269 lines
                    
29if my_name:match("[/\\]") then
                    
30	package.path = package.path..";"..my_name:gsub("[^/\\]+$", "../?.lua");
                    
31	package.cpath = package.cpath..";"..my_name:gsub("[^/\\]+$", "../?.so");
                    
                
WebUIDelegatePrivate.h https://review.tizen.org/git/ | C Header | 251 lines
                    
79    WebMenuItemTagCorrectSpellingAutomatically,
                    
80    WebMenuItemTagSubstitutionsMenu,
                    
81    WebMenuItemTagShowSubstitutions,
                    
                
jdbc_oracle.rb git://github.com/acangiano/ruby-benchmark-suite.git | Ruby | 377 lines
                    
145        # Extract the table from the insert sql. Yuck.
                    
146        table = sql.split(" ", 4)[2].gsub('"', '')
                    
147        sequence_name ||= default_sequence_name(table)
                    
326    def quote_string(string) #:nodoc:
                    
327      string.gsub(/'/, "''")
                    
328    end
                    
                
event.rb git://github.com/guard/guard.git | Ruby | 140 lines
                    
115      @cookie = @native[:cookie]
                    
116      @name = data[@native.size, @native[:len]].gsub(/\0+$/, '')
                    
117      @notifier = notifier
                    
                
parser.rb git://github.com/jphastings/thimblr.git | Ruby | 389 lines
                    
57      # Changes for Thimblr
                    
58      @theme.gsub!(/href="\//,"href=\"/thimblr/")
                    
59      
                    
63        if meta[1] == "if"
                    
64          @blocks[meta[2].gsub(/(?:\ |^)\w/) {|s| s.strip.upcase}] = (value == 1)
                    
65        else
                    
144      blocks.merge! constants['}blocks'] if !constants['}blocks'].nil?
                    
145      string.gsub(/\{block:([\w:]+)\}(.*?)\{\/block:\1\}|\{([\w\-:]+)\}/m) do |match| # TODO:add not block to the second term
                    
146        if $2 # block
                    
199                  post['ShortURL'] = post['Permalink'] # No need for a real short URL
                    
200                  post['TagsAsClasses'] = (post['Tags'] || []).collect{ |tag| tag.gsub(/[^a-z]/i,"_").downcase }.join(" ")
                    
201                  post['}numberonpage'] = n + 1 # use a } at the begining so the theme can't access it
                    
295            repeat = constants['Tags'].collect do |tag|
                    
296              {"Tag" => tag,"URLSafeTag" => tag.gsub(/[^a-zA-Z]/,"_").downcase,"TagURL" => "/thimblr/tagged/#{CGI.escape(tag)}","ChronoTagURL" => "/thimblr/tagged/#{CGI.escape(tag)}"} # TODO: ChronoTagURL
                    
297            end
                    
                
AIManager.hxx git://pkgs.fedoraproject.org/FlightGear | C++ Header | 145 lines
                    
43
                    
44class FGAIManager : public SGSubsystem
                    
45{
                    
                
wikipedia.tcl http://cklib.googlecode.com/svn/trunk/ | TCL | 202 lines
                    
63    }
                    
64    regsub -all -- {\s} $req {_} req
                    
65
                    
114    set req [lindex $resultraw [incr sindex -1]]
                    
115    regsub -all -- {\s} $req {_} req
                    
116    session export -grab "req"
                    
156  regfilter -all {<div class="notice metadata".*?</div>} HttpData
                    
157  regsub -all -- {&#160;} $HttpData { } HttpData
                    
158  set extmark [config get "extmark"]
                    
                
rubytypes.rb git://github.com/rubinius/rubinius.git | Ruby | 410 lines
                    
49    yaml_as "tag:ruby.yaml.org,2002:struct"
                    
50    def self.yaml_tag_class_name; self.name.gsub( "Struct::", "" ); end
                    
51    def self.yaml_tag_read_class( name ); "Struct::#{ name }"; end
                    
                
fgraph.rb git://github.com/jugend/fgraph.git | Ruby | 401 lines
                    
65      # Note: FB pass access token with '|' character, which cause URI::InvalidURIError
                    
66      uri = URI.parse(url.gsub('|', '%7C'))
                    
67      
                    
                
formtags.h http://upp-mirror.googlecode.com/svn/trunk/ | C Header | 241 lines
                    
45  ((unsigned char)0x03)
                    
46#define FT_ptgSub                               \
                    
47  ((unsigned char)0x04)
                    
                
hive.cgi http://ruby-hive.googlecode.com/svn/trunk/ | Ruby | 362 lines
                    
36        @link.keys.each {|exp|
                    
37            str.gsub!(Regexp.new(exp)){|m|
                    
38                m = %(<a href="#{@url}?page=#{$~[@link[exp][:page]]}">#{$~[@link[exp][:name]]}</a>)
                    
42        #normal link
                    
43        str.gsub!(/\[\[(.+?)\]\]/){|m|
                    
44            pname = $1
                    
73        #mode
                    
74        str.gsub!(/\(\((.+?)\)\)/){|m|
                    
75            sstr = $1
                    
123    def cleanup(str)
                    
124        str.gsub("\t", "&nbsp;&nbsp;&nbsp;&nbsp;").gsub("  ", "&nbsp;&nbsp;").gsub(/~+/){|m|
                    
125            if m == '~'
                    
129            end
                    
130        }.gsub(/<\|/,'&lt;').gsub(/\|>/,'&gt;').gsub(/~~/,'~')
                    
131    end
                    
                
InDialogNotifierSipServletTest.java http://mobicents.googlecode.com/svn/trunk/ | Java | 185 lines
                    
102	 */
                    
103	public void testInDialogSubscriptionByeSentBeforeTerminatingNotify() throws InterruptedException, SipException, ParseException, InvalidArgumentException {
                    
104		String fromName = "sender";
                    
143	 */
                    
144	public void testInDialogSubscriptionByeSentAfterTerminatingNotify() throws InterruptedException, SipException, ParseException, InvalidArgumentException {
                    
145		String fromName = "sender";
                    
                
lauxlib.h https://marathon.svn.sourceforge.net/svnroot/marathon | C++ Header | 175 lines
                    
84
                    
85LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
                    
86                                                  const char *r);
                    
                
newsblogOverlay.js git://pkgs.fedoraproject.org/thunderbird | JavaScript | 145 lines
                    
47  let subscriptionsWindow =
                    
48    Services.wm.getMostRecentWindow("Mail:News-BlogSubscriptions");
                    
49
                    
                
imagelistview.lua http://conflictterra.googlecode.com/svn/ | Lua | 279 lines
                    
42local function GetParentDir(dir)
                    
43  dir = dir:gsub("\\", "/")
                    
44  local lastChar = dir:sub(-1)
                    
61local function ExtractFileName(filepath)
                    
62  filepath = filepath:gsub("\\", "/")
                    
63  local lastChar = filepath:sub(-1)
                    
80local function ExtractDir(filepath)
                    
81  filepath = filepath:gsub("\\", "/")
                    
82  local lastChar = filepath:sub(-1)
                    
                
itunes.rb git://github.com/ruby/ruby.git | Ruby | 244 lines
                    
8      def def_class_accessor(klass, name, type, *args)
                    
9        name = name.gsub(/-/, "_").gsub(/^itunes_/, '')
                    
10        full_name = "#{RSS::ITUNES_PREFIX}_#{name}"
                    
                
inflect.rb http://waves.googlecode.com/svn/trunk/ | Ruby | 194 lines
                    
82      singularization_rules.each do |(match, replacement)|
                    
83        break if result.gsub!(match, replacement)
                    
84      end
                    
99      pluralization_rules.each do |(match, replacement)|
                    
100        break if result.gsub!(match, replacement)
                    
101      end
                    
                
LuceneSearch.java http://androjena.googlecode.com/svn/trunk/ | Java | 304 lines
                    
52    @Override
                    
53    public void build(PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)
                    
54    {
                    
54    {
                    
55        super.build(argSubject, predicate, argObject, execCxt) ;
                    
56        if ( getIndex(execCxt) == null )
                    
58
                    
59        if ( argSubject.isList() && argSubject.getArgListSize() != 2 )
                    
60                throw new QueryBuildException("Subject has "+argSubject.getArgList().size()+" elements, not 2: "+argSubject) ;
                    
66    @Override
                    
67    public QueryIterator execEvaluated(Binding binding, PropFuncArg argSubject, Node predicate, PropFuncArg argObject, ExecutionContext execCxt)
                    
68    {
                    
69    	try { 
                    
70    		return execEvaluatedProtected(binding, argSubject, predicate,  argObject,  execCxt) ;
                    
71    	} catch (RuntimeException ex)
                    
                
http.tcl git://github.com/yangsiwei880813/RealTime.git | TCL | 0 lines
                    
31    }
                    
32    regsub -all -- - $options {} options
                    
33    set pat ^-([join $options |])$
                    
105    set usage [join $options ", "]
                    
106    regsub -all -- - $options {} options
                    
107    set pat ^-([join $options |])$
                    
172    foreach {key value} $state(-headers) {
                    
173	regsub -all \[\n\r\]  $value {} value
                    
174	set key [string trim $key]
                    
360    }
                    
361    regsub -all \[^$alphanumeric\] $string {$httpFormMap(&)} string
                    
362    regsub -all \n $string {\\n} string
                    
362    regsub -all \n $string {\\n} string
                    
363    regsub -all \t $string {\\t} string
                    
364    regsub -all {[][{})\\]\)} $string {\\&} string
                    
                
 

Source

Language