similar to: Gem/Plugin to Convert Ruby Regexp to Javascript Regexp?

Displaying 20 results from an estimated 30000 matches similar to: "Gem/Plugin to Convert Ruby Regexp to Javascript Regexp?"

2006 Feb 21
2
validates_format_of :url, regexp?
Hey, Does anybody have a regexp for validating URLs? I found this one and am trying to adapt it: ^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\''\\\+&%\$#\=~_\-]+))*$ (http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21245168.html) I also found this one, but, um,
2003 Nov 27
2
ENUM regexp replacements
Anyone succeeded in using regexp replacements in ENUM, like "!\\+421257296(.*)$!sip:2\\1@stuba.sk!" I can't get it to work in ASterisk. I've added '\\1' and Debug echos "1" I've added '\\\\1' and debug echoes "\1", but regexp fails to work. The example above is from the nic.at presentation, I can't get it to work. /Olle
2006 Jun 05
5
Regexp - date validation
Can somebody tell me why the following RegExp doesn''t work for date validation in Rails... It validates fine in RadRails -- using REgExp panel. Intended format: (mm/dd/yyyy): %r{^(0[1-9]|1[012])(-|/)(0[1-9]|[12][0-9]|3[01])(-|/)(19|20)([0-9][0-9])$} If i try the following, it works in Rails: %r{(0[1-9]|1[012])(-|/)(0[1-9]|[12][0-9]|3[01])} When I add the last piece, it
2017 Feb 22
2
help with RewriteRule regexp
My regexp skills are somewhere infinitesimally close to zero. I have never really 'gotten' them. That said, I have spent a couple hours already search for help to write a rewriterule that works on a string in the URL. In particular I want success if either of the following were provided: webmail.domain (e.g. webmail.foo.com) server/webmail (e.g. www.foo.com/webmail) And I have not
2017 Feb 23
1
help with RewriteRule regexp
Hmmm, maybe I spoke too soon, why the second test didn't match isn't obvious to me (unless Apache regex is different from grep). ----- Original Message ----- From: "Leroy Tennison" <leroy at datavoiceint.com> To: "centos" <centos at centos.org> Sent: Thursday, February 23, 2017 10:15:54 AM Subject: Re: [CentOS] help with RewriteRule regexp And it won't
2007 Jun 27
5
Regexp not matched
Sorry, meant to post this in the rails forum. Anyways, how would I write a rescue method to recover from a failed regexp parsing with error "regexp not matched" -Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post
2017 Feb 23
2
help with RewriteRule regexp
I tried: RewriteRule ^webmail\.|/webmail https://%{SERVER_NAME}%{REQUEST_URI} [L,R] But that does not rewrite for http://webmail.domain On 02/22/2017 06:41 PM, Robert Moskowitz wrote: > Seems I left off one point in this message. > > This is to refine these rules in my Apache server. > > RewriteCond %{SERVER_PORT} !^443$ > RewriteRule ^.*$
2006 Apr 07
1
regexp in gotoif
Hello! this is a short one: in a gotoif-statement i would like to match a variable to a number, where the number could have digits from 2-6. asterisk only seems to be capable to match such a digit-range when used in the extension, but not in a regexp, at least the following query doesn't work: exten => _X.,1,GotoIf($[${EXTEN} : 234[2-6]]?jump:) obviously asterisk has a problem with
2010 Apr 19
3
stupid regexp question
Hello, I have a stupid regexp question. I have a large data frame of strings. I would like to convert all occurences of : "W.m^{-2}" to "W/m2" I make the following test : gsub(glob2rx("W.m^{-2}"), "W/m2", "W.m^{-2}") but it does not seem to work. I don't know how to do it otherwise as I could never learn how to deal with the special
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
2009 Feb 25
3
regexp capturing group in R
Hello, Newbie question: how do you capture groups in a regexp in R? Let's say I have txt="blah blah start=20080101 end=20090224". I'd like to get the two dates start and end. In Perl, one would say: my ($start,$end) = ($txt =~ /start=(\d{8}).*end=(\d{8})/); I've tried: txt <- "blah blah start=20080101 end=20090224" m <-
2011 Jul 01
2
regexp problem
Hi I have a question concerning regexp - I want to select with grep all character strings which contain the numbers 11:20 (code below). At the moment I am using [], but that obviously does not work, as it matches each element in the []. Is there a way to specify that the regexp should match 11, but not 1? Here is the code code: x <- paste("suff", 1:40, "pref",
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 Jan 27
1
gsub regexp question
Dear R Users, I am trying to users gsub to remove multiple cases of square brackets and their different contents in a character string. A sample of such a string is shown below. However, I am having great difficulty understanding regexp syntax. Any help is greatly appreciated. Ally "tree STATE_286000 [&lnP=-12708.453945423369] = [&R]
2011 Dec 09
2
unexpected behaviour of sub() / usage of regexp
Dear R users, the way I understand the documentation of sub() and regexp the following code: sub('[[:digit:]]{1,2}', '', '9ewww') ... should yield: 'ewww' It returns, however: 'www' Why is this the case? My code should just substitute 1 (minimum) or up to 2 (maximum) digits, i.e. numbers and not the 'e' in the string. Do I misinterpret
2020 May 14
1
Sieve regexp matches wrong
Hello! Recently I've faced with strange issue. So, I want to filter some mails which do not contain cyrillic symbols. I would not like receive email on foreign language except russian and I'm using rule below, but it does not work when text of mail has unicode symbol u2019 or ? - right single quotation mark. |require ["body","regex"];| |# rule:[Regexp test]| |if
2007 Feb 16
13
negate the regexp in validates_format_of
Railsters: ActiveRecord''s validation system puts other database systems to shame. However, the newbies might not know how to write a regexp that excludes a match, instead of tests for it. Understand - I''m just asking this question to help them. I have been using Regexps since ''grep'' on Xenix! But the newbies here might not know how to do this:
2007 May 11
1
Cannot use an escape character in regexp
Given the string > mystr <- "(Preconsuntivo del giorno gas 10 maggio 2007)Tj" I'm trying to detect and eliminate the string ")Tj" at the very end of mystr by means of gsub(rx2,"",mystr) BUT preparing the matching regexp string a warning pops up > rx2 <- "\)Tj$" Warning messages: 1: '\)' is an unrecognized escape in a
2008 Aug 30
1
strsplit and regexp
Dear list, I am trying to split a string using regexp: x <- "2 Value 34 a-c 45 t" strsplit(x, "[0-9]") [[1]] [1] "" " Value " "" " a-c " "" " t" But I don't want to lose the digits (pattern), the result should be: [[1]] [1] "2" " Value " "34" " a-c "
2006 Feb 19
4
Multiple Characters Negate Using Regexp
Dear experts, I am trying to build a regular expression to filter out anything between <script ... > and </script> tags where I can specify something using negate class to exclude more than one character in sequence. I tried: originalresponse.gsub(/<script([^>]+)>([^<]+)?<\/script>/,'''') but obviously if the script has the