» Home » regExp » Page 1
Incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) on Heroku
by ozymandius42 in Programming Languages

I have a Rails application where I use regex-based rules to categorize transactions. In my seeds.rb, I create some categories and rules, then import transactions from a CSV file (also utf8-encoded) and allow them to be categorized. This process works fine on my development machine, but when I run it on Heroku, I get:

incompatible encoding regexp match (ASCII-8BIT rege

best REGEXP friendly Text Editors + most powerful REGEXP syntax?
by James Dio in Programming Languages

I am fluent with Microsoft Visual 2005 regular expressions and they are a big time saver.

I seem to learn them best by having a vaguely organized cheat sheet thrown at me, at which point I read just a little and play with them until I understand what's going on. That learning approach has worked well for me, for now.

I would really like to take this to the next level tho

emacs regexp-builder doesn't work in replace-regexp
by snapshooter in Programming Languages

I have an emacs buffer containing the text


using the regexp-builder, i create the regexp


and can see the match highlighting (b2, with the 2 in a different colour).

however, when i paste the expression into replace-regexp, i get 0 matches. both with and without the quotes. to get a matc

Rake assets:precompile error: incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)
by Juice in Programming Languages

WHen running rake assets:precompile I get the following error:

Caught Encoding::CompatibilityError at '["ok","function View': incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)
(in /Users/jethro/Dropbox/Rails/ol2/app/assets/javascripts/application.js)

I had not encountered this problem before pulling a push from Gi

Is there a performance gain if you don't use new in front of RegExp() vs. simply RegExp()?
by mrmt in Web Design

I want to replace all occurrences of a substring in a string.
Will there be any difference between the following two examples?

var str='A horse walks into a bar and the bartender asks "Hey, why the long face?".';
str.replace(new RegExp('bar','g'),'restaurant');
// versus

This is a simplif

regexp in bash (downloading output form regexp)
by AndyD2k in Programming Languages

I have got a file that look like:

<a href="some-adress">some-txt</a>
<a href="some-adress">some-txt</a>
<a href="some-adress">some-txt</a>

I need to download all files that are as "some-adress", how can I do that using only bash?

Inconsistent behavior with RegExp Object in RegExp.match
by Roel van Dijk in Web Design

I have detect a strange behavior in regexps created with the RegExp object:

With this code:

var exp1 = /./;
var exp2 = new RegExp('.');

var test1 = exp1.test('large
var test2 = exp2.test('large

var match1 = 'large
var match2 = 'large

regexp that selects only the capital letter from another regexp
by DaveF in Web Design

I have this type of text:

!D este caro
1 C este descgiderea
C1 este alta deschidere
Deschiderea de 1C este cu
3 D

This easy regexp:


selects "1C","2C","2D","2D" (a digit immediately followed by [CDHS], anywhere in the text) .

What I want is to sel

Is it possible to simulate string.match with a regexp.exec loop when the regexp matches the empty string?
by Master843 in Web Design

It is common knowledge that the exec method from RegExps can get used to find all matches in a string. However, I just found out that if the regexp matches the empty string this loop can get stuck forever

var s = '1234'
var r = /()/g;
var m;
var i = 0;
while( (m = r.exec(s)) ){
console.log(i, m[0]);
if(++i >= 50){ console.log("infinite loop!

regarding regexp in PHP
by drudge in PHP

I'm decent at PHP(far from an expert) but a pure novice when it comes to regexp and scraping. I wanted to do a little bit of scraping to help with some research and to educate myself, but I've ran into a problem. I want to extract prize from the following part of a page:

<th valign="top"> Prize pool:
<td> $75,000
TAGS : regarding regexp

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .