similar to: Named capture in regexp

Displaying 20 results from an estimated 400 matches similar to: "Named capture in regexp"

2024 Jan 29
1
strcapture performance when perl = TRUE
I wanted to raise the possibility of improving strcapture performance in cases where perl = TRUE. I believe we can do this in a non-breaking way by calling regexpr instead of regexec (conditionally when perl = TRUE). To illustrate this I've put together a 'proof of concept' function called strcapture2 that utilises output from regexpr directly (following a very nice substring approach
2007 May 22
1
regexp bug in very recent r-devel
completion is semi-broken in today's r-devel, and the reason seems to be some regular expression changes: > sessionInfo() R version 2.6.0 Under development (unstable) (2007-05-22 r41673) i686-pc-linux-gnu locale: [...] attached base packages: [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7]
2009 Nov 20
1
Gem/Plugin to Convert Ruby Regexp to Javascript Regexp?
Just a quick question or maybe a suggestion, is there a gem/plugin that will convert ruby regexp to javascript regexp? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2006 May 06
2
regular expression change in R version 2.3.0?
The interpretation of regular expressions with repetition quantifiers in the 'gregexpr' function seems to have changed between R Version 2.2.0 and 2.3.0. The 'gsub' function, however, gives the same results in R Versions 2.2.0 and 2.3.0. Below is an example that demonstrates the version differences of the 'gregexpr' function. I am not sure whether this new behavior is
2007 Aug 30
0
Why Regexp#freeze?
I notice in recent commits that a number of these have been added: /\[(\d+)\]/.freeze I thought that Regexps are immutable. Furthermore, Regexp literals don''t generate a new object each time they are encountered: irb(main):001:0> 3.times { puts /\d+/.object_id } -605707646 -605707646 -605707646 => 3 irb(main):002:0> Unlike strings: irb(main):002:0> 3.times { puts
2007 Jul 13
1
Regexp Question - Merb::Router
Hi, I''m looking through the Merb::Routing code and I''ve found a regexp that I can''t figure out how it works. Merb::Router::SECTION_REGEXP #=> /(?::([a-z*_]+))/ It takes a route definition string, like "/products/:model/:id" and extracts the "model" string on the first pass, and later the "id" string. Can anyone shed some light on
2007 Dec 03
3
pcre vs. regexp for Postfix checks
What are your opinions on pcre vs regexp for header_, body_, and mime_checks in Postfix? I looked at the regexp_table and prce_table man pages, and see almost no difference other than the available flags. Miark
2006 Jun 07
0
Using a RegExp to exclude an email address
How would I use a regular expression to eclude an email address? I''m using validates_format_of :username, :with => :message => "Your username cannot be an email address." What is the expression to use after "with: =>" to exclude an "@"? -- Posted via http://www.ruby-forum.com/.
2006 Jun 13
0
HTTP validation regexp, possible solution
There was an old email thread from the end of January 2006 discussing regular expressions for matching URLs. I took some of the sample expressions and tweaked them a bit to the point where I think they are pretty useful. They pass all of my tests anyway. :-) For a reminder, here''s a sample message from that thread. My code is below it. On Jan 26, 2006, at 5:28 AM, Nathaniel S.
2007 Apr 25
0
Redcloth bug - Stack overflow in regexp matcher
Hi, I''ve been using the rassmalog static blogging engine and have encountered a stack overflow inside the redcloth regexp matcher. I don''t seem to suffer this error on my Ubuntu (Feisty Fawn) box (with Ruby 1.8.4??), but I do get it on my Gentoo system. Running the following line will generate it (I''ve attached the YAML/redcloth file to this message). $ ruby -ryaml
2005 Aug 21
0
Patch for Element.Class - wrong regexp
Hello, I noticed (due to a recent post by Martin Honnen to clp) that Element.Class uses wrong regexps for its operations. E.g., Element.Class.has() will find "classA" in "classA-foobar" I also changed the interface of .has() to the more general one used in .has_any() --- util.js.old 2005-08-21 19:18:40.000000000 +0200 +++ util.js 2005-08-21 19:31:42.000000000 +0200 @@
2006 Feb 08
0
Stange regexp problem with case sensitivity
Environment: CentOS 4.2 (RHES4 clone) Ruby 1.8.4 Rails 1.0 I am having a small difficulty with case sensitive matching in some ruby code: f_nam_re = Regexp.new(f_nam_re_s,"x") produces these test results: The passed regexp: ^QPCCCMR[[:digit:]]$ The regexp used is: /^QPCCCMR[[:digit:]]$/i $= is false qpcccmr1 matches QPCCCMR1 matches QPCCMMR1 does not match qpCCCMR1 matches QPCCCMRC
2006 Feb 28
0
Word wrap regexp question
>From the rails helper, there''s a text wrap method that does this (I''ve removed the trailing .strip): text.gsub(/\n/, "\n\n").gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n") The way I read this, it''s "replace every newline with two newlines (and it''s not clear to me either what this first part is supposed to accomplish), then replace
2006 Nov 15
0
Bug#398163: Sorry, my regexp was wrong a bit
Package: logcheck-database Version: 1.2.50 Followup-For: Bug #398163 I wrote wrong regexp in my last mail, the right one is In /etc/logcheck/ignore.d.server/postfix ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ postfix/cleanup\[[0-9]+\]: [[:alnum:]]+: (resent-|)message-id=<[[:alnum:].]+@[-_.[:alnum:]]+>$ should be ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ postfix/cleanup\[[0-9]+\]: [[:alnum:]]+:
2011 May 12
1
RegExp does not match
Hi, When I try this on IRB it works fine as follows: >>/\A[\w+\-.!#$\%&''*\/\=?^`{|}~]+@[a-z\d\-.]+\.[a-z]+\z/.match("jd!#$\%&''*+-/=?^_`{|}~oe-PV5Ro7/Mrj4@public.gmane.org") => #<MatchData "jd!%&''*+-/=?^_`{|}~oe-PV5Ro7/Mrj4@public.gmane.org"> When I try it through my Ruby on Rails program I get a nil. Any idea what is
2006 May 17
2
Bug#367781: logcheck-database: postfix/smtp read timeout (port 25) regexp wrong
Package: logcheck-database Version: 1.2.39 Severity: normal The rule for postfix/smtp read timeout (port 25) doesn't match the actual log message: ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ postfix/smtp\[[0-9]+\]: connect to [^[:space:]]+ \[[.0-9]+\]: read timeout \(port 25\)$ A sample log line is: May 17 17:38:16 dp postfix/smtp[12256]: connect to smtpv1.ihs.gov[198.45.3.65]: read timeout (port
2006 Apr 18
0
Bug#363336: logcheck-database: incomplete regexp for popa3d log message
Package: logcheck-database Version: 1.2.43a Severity: normal Tags: patch Hi, Given the following popa3d log messages: popa3d[15636]: 0 messages (0 bytes) loaded popa3d[15993]: 1 message (3837 bytes) loaded popa3d[15856]: 3 messages (18116 bytes) loaded The current logcheck ruleset does not take into account that sometimes there might be multiple message_S_ to be loaded. The following patch
2009 Jul 06
0
Routing via regexp with map.resources?
I have a requirement to support a query syntax on my resources like so: http://localhost:3000/people(last_name=jones).xml I can hook that up so that the people controller receives that action via map.connect like so: map.connect '':people_query_regexp'', :controller => ''people'', :index => ''index'',
2007 Dec 24
0
Regexp#quote in request.rb
in request.rb (line 503) you''ll find quoted_boundary = Regexp.quote(boundary, "n") using the super secret never documented second argument to Regexp.quote. Ruby 1.9 has done away with that second argument. I couldn''t find much about what this argument does (my best guess I could find was that it sets what multibyte handling to use, with n being none). Does this
2007 Nov 21
0
Expiring page caches with regexp?
Is there a way to expire page caches using regular expressions like you can with fragment caches? I''m writing an app which has a catalogue style product listing but not full on e-commerce. It''s pretty simple; with just categories and products within them. A url for a product called "Band Saws" within the category "Heavy duty saws" would look like