Search Results

Search found 530 results on 22 pages for 'regexp'.

Page 11/22 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Rewrite Generic URLs into real URLs on Google Analytics

    - by valdroni
    I have an iPhone app for a forum which also has a limited Google Analytics reporting. This app reports the page views in following generic form: /forum/67 /thread/29036 etc... The numbers above represent forum and thread ID's I am trying to set an Advanced filter, which will rewrite/report the page views in Google Analytics in following form: http://www.mysite.com/forum-67.html http://www.mysite.com/thread-29036.html Can someone please assist me in creating an Advanced Google Analytics filter which will enable me to see URL's so they can be live and send to correct page. Is there another method to achieve what I'm looking for ? Obviously there will be a need for some RegExp matches, but I cannot get around it.

    Read the article

  • Single ErrorDocument directive to catch all errors (.htaccess)

    - by Mike Valeriano
    Hello. Is there something like a wildcard directive to catch all possible errors and deal with them in a single custom error page? ErrorDocument 404 /error.php?code=404 ErrorDocument 403 /error.php?code=403 ... ErrorDocument NNN /error.php?code=NNN #possible use of RegExp? I know I probably won't be dealing with a lot of custom error pages here, but I'm curious about this.

    Read the article

  • Convert Plain Text Hyperlinks into HTML Hyperlinks in PHP

    - by Volomike
    I have a simple commenting system here... http://affbuzz.com/comments/7299a55137def55917a5dc6c4fe0f261af8a4217 ...and people can submit hyperlinks inside the plain text field. When I display these records back from the database and into the web page, what RegExp in PHP can I use to convert these links into HTML-type anchor links? Bonus: For the algorithm to not do this with any other kind of link, just http and https.

    Read the article

  • Extract parameter value from url using regular expressions

    - by Oscar Reyes
    This should be very simple ( when you know the answer ). From this question I want to give it a try to the posted solution. And my question is: How to get the parameter value of a given url using javascript regexp? I have: http://www.youtube.com/watch?v=Ahg6qcgoay4 I need: Ahg6qcgoay4 I tried: http://www.youtube.com/watch\\?v=(w{11}) But: I suck...

    Read the article

  • Irc server for ubuntu

    - by Ralphz
    The Ubuntu WIKI https://help.ubuntu.com/community/IrcServer it lists few IRC servers you can use in Ubuntu. My question is which one is you favorite one and more secure. I will also need one that will allow me to monitor rooms for regular expressions and run some scripts if regexp matches. Thanks

    Read the article

  • Regular expression that contains in it...

    - by Fabiano PS
    I need my regexp to match, all the highlighted words, in order, following: Fri/Feb/10 - *Nesta* manh\303\203\302\243,* @*anestesya *entrou* \303\240s 08:18AM Fri/Feb/10 - *Nesta* tarde,* @*pernas *saiu* \303\240s 08:18AM I was trying something like: /[?=Nesta.?=@.?=(entrou|saiu)]/ So I don't care what is in between as long as it has: ' Nesta ' AND ' @' AND ' entrou ' OR ' saiu '

    Read the article

  • Easy Javascript Regex Question

    - by Matrym
    Why doesn't this assign prepClass to the string selectorClass with underscores instead of non alpha chars? What do I need to change it to? var regex = new RegExp("/W/", "g"); var prepClass = selectorClass.replace(regex, "_");

    Read the article

  • Why do I get extra, unexpected results with my ack regex?

    - by Gauthier
    I'm finally learning regexps and training with ack. I believe this uses Perl regexp. I want to match all lines where the first non-blank characters are if (<word> !, with any number of spaces in between the elements. This is what I came up with: ^[ \t]*if *\(\w+ *! It only nearly worked. ^[ \t]* is wrong, since it matches one or none [space or tab]. What I want is to match anything that may contain only space or tab (or nothing). For example these should not match: // if (asdf != 0) else if (asdf != 1) How can I modify my regexp for that? EDIT adding command line ack -i --group -a '^\s*if *\(\w+ *!' c:/work/proj/proj Note the single quotes, I'm not so sure about them anymore. My search base is a larger code base. It does include matching expressions (quite some), but even for example: 274: }else if (y != 0) , which I get as a result of the above command. EDIT adding the result of mobrule's test Mobrule, thanks for providing me a text to test on. I'll copy here what I get on my prompt: C:\Temp\regex>more ack.test # ack.test if (asdf != 0) # no spaces - ok if (asdf != 0) # single space - ok if (asdf != 0) # single tab - ok if (asdf != 0) # multiple space - ok if (asdf != 0) # multiple tab - ok if (asdf != 0) # spaces + tab ok if (asdf != 0) # tab + space ok if (asdf != 0) # space + tab + space ok // if (asdf != 0) # not ok } else if (asdf != 0) # not ok C:\Temp\regex>ack '^[ \t]*if *\(\w+ *!' ack.test C:\Temp\regex>"C:\Program\git\bin\perl.exe" C:\bat\ack.pl '[ \t]*if *\(\w+ *!' a ck.test if (asdf != 0) # no spaces - ok if (asdf != 0) # single space - ok if (asdf != 0) # single tab - ok if (asdf != 0) # multiple space - ok if (asdf != 0) # multiple tab - ok if (asdf != 0) # spaces + tab ok if (asdf != 0) # tab + space ok if (asdf != 0) # space + tab + space ok // if (asdf != 0) # not ok } else if (asdf != 0) # not ok The problem is in my call to my ack.bat! ack.bat contains: "C:\Program\git\bin\perl.exe" C:\bat\ack.pl %* Although I call with a caret, it gets away at the call of the bat file! Escaping the caret with ^^ does not work. Quoting the regex with " " instead of ' ' works. My problem was a DOS/win problem, sorry for bothering you all for that.

    Read the article

  • How to sort output of "s3cmd ls"

    - by dba.in.ua
    Amazon "s3cmd ls" takes like this output: 2010-02-20 21:01 1458414588 s3://file.tgz.00 2010-02-20 21:10 1458414527 s3://file.tgz.01 2010-02-20 22:01 1458414588 s3://file.tgz.00 2010-02-20 23:10 1458414527 s3://file.tgz.01 2010-02-20 23:20 1458414588 s3://file.tgz.02 How to select all files of archive, ending at 0 ... X, with the latest date of fileset ? Bash, regexp ? Thanx!

    Read the article

  • format string (postcode) in ruby

    - by noddy
    I need to re-format a list of UK postcodes and have started with the following to strip whitespace and capitalize: postcode.upcase.gsub(/\s/,'') I now need to change the postcode so the new postcode will be in a format that will match the following regexp: ^([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]? {1,2}[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)$ I would be grateful of any assistance.

    Read the article

  • vbscript multiple replace regex

    - by George
    How do you match more than one pattern in vbscript? Set regEx = New RegExp regEx.Pattern = "[?&]cat=[\w-]+" & "[?&]subcat=[\w-]+" // tried this regEx.Pattern = "([?&]cat=[\w-]+)([?&]subcat=[\w-]+)" // and this param = regEx.Replace(param, "") I want to replace any parameter called cat or subcat in a string called param with nothing. For instance string?cat=meow&subcat=purr or string?cat=meow&dog=bark&subcat=purr I would want to remove cat=meow and subcat=purr from each string.

    Read the article

  • How to use regular expression in lxml xpath?

    - by Arty
    I'm using construction like this: doc = parse(url).getroot() links = doc.xpath("//a[text()='some text']") But I need to select all links which have text beginning with "some text", so I'm wondering is there any way to use regexp here? Didn't find anything in lxml documentation

    Read the article

  • Remove a tag type from the view (involves alphabetical pagination)

    - by user284194
    I have an index view that lists all of the tags for my Entry and Message models. I would like to only show the tags for Entries in this view. I'm using acts-as-taggable-on. Tags Controller: def index @letter = params[:letter].blank? ? 'a' : params[:letter] @tagged_entries = Tagging.find_all_by_taggable_type('Entry').map(&:taggable) @title = "Tags" if params[:letter] == '#' @data = Tag.find(@tagged_entries, :conditions => ["name REGEXP ?", "^[^a-z]"], :order => 'name', :select => "id, name") else @data = Tag.find(@tagged_entries, :conditions => ["name LIKE ?", "#{params[:letter]}%"], :order => 'name', :select => "id, name") end respond_to do |format| flash[:notice] = 'We are currently in Beta. You may experience errors.' format.html end end tags#index: <% @data.each do |t| %> <div class="tag"><%= link_to t.name.titleize, tag_path(t) %></div> <% end %> I want to show only the taggable type 'Entry' in the view. Any ideas? Thank you for reading my question. SECOND EDIT: Tags Controller: def index @title = "Tags" @letter = params[:letter].blank? ? 'a' : params[:letter] @taggings = Tagging.find_all_by_taggable_type('Entry', :include => [:tag, :taggable]) @tags = @taggings.map(&:tag).sort_by(&:name).uniq @tagged_entries = @taggings.map(&:taggable)#.sort_by(&:id)#or whatever if params[:letter] == '#' @data = Tag.find(@tags, :conditions => ["name REGEXP ?", "^[^a-z]"], :order => 'name', :select => "id, name") else @data = Tag.find(@tags, :conditions => ["name LIKE ?", "#{params[:letter]}%"], :order => 'name', :select => "id, name") end respond_to do |format| format.html end end tags#index: <% @data.each do |t| %> <div class="tag"><%= link_to t.name.titleize, tag_path(t) %></div> <% end %> Max Williams' code works except when I click on my alphabetical pagination links. The error I'm getting [after I clicked on the G link of the alphabetical pagination] reads: Couldn't find all Tags with IDs (77,130,115,...) AND (name LIKE 'G%') (found 9 results, but was looking for 129) Can anyone point me in the right direction?

    Read the article

  • postgres - regex_replace in distinct clause?

    - by n00b0101
    Ok... changing the question here... I'm getting an error when I try this: SELECT COUNT ( DISTINCT mid, regexp_replace(na_fname, '\\s*', '', 'g'), regexp_replace(na_lname, '\\s*', '', 'g')) FROM masterfile; Is it possible to use regexp in a distinct clause like this? The error is this: WARNING: nonstandard use of \\ in a string literal LINE 1: ...CT COUNT ( DISTINCT mid, regexp_replace(na_fname, '\\s*', ''...

    Read the article

  • stripping a query string with php (preg_replace)

    - by pg
    http://www.chuckecheese.com/rotator.php?cheese=4&id=1 I want to take out the id, leaving the cheese to stand alone. I tried: $qs = preg_replace("[^&id=*]" ,'',$_SERVER[QUERY_STRING]); But that said I was using an improper modifier. I want to remove "$id=" and whatever number comes after it. Are regexp really as hard as they seem for me?

    Read the article

  • Lightweight multi os monitoring plateform

    - by user293995
    Hi, I have a project where the is windows, freebsd and linux servers. I have to monitor some services : mysql replication status www status status with regexp on a webpage space on disk Is there open source software to do this and rapid to deploy ? Thanks in advance Best regards

    Read the article

  • Regular Expression TCL using procedure

    - by user329763
    Hey everybody, I am a novice TCL programmer.Here I go My 1st post with stackoverflow forum. I would like to write a regular expression that matches any & only the strings starts with character A and ends with B. Whatever the characters coming inbetween should be displayed. For instance AXIOMB as an input from the user which starts with A & end with character B. Here is my try regexp { (^A([C-Z]+)B$)} Thank you

    Read the article

  • `strip`ing the results of a split in python

    - by Igor
    i'm trying to do something pretty simple: line = "name : bob" k, v = line.lower().split(':') k = k.strip() v = v.strip() is there a way to combine this into one line somehow? i found myself writing this over and over again when making parsers, and sometimes this involves way more than just two variables. i know i can use regexp, but this is simple enough to not really have to require it...

    Read the article

  • wildcards to use in codeigniter routing?

    - by ajsie
    in codeigniter you can use wildcard to reroute. i never heard the word wildcards before. is this a set of rules you can use like regexp? cause in codeigniter documentation they just gave some examples eg. $route['product/(:num)'] = "catalog/product_lookup_by_id/$1"; is there a list/reference with all the available wildcard expressions you can use?

    Read the article

  • JS regex and angle brackets

    - by chaz
    Seriously, why can't I parse a string with angle brackets using the Javascript regular expression object? var r = new RegExp(), r; r.compile("\\<div\\>", "g"); r = r.exec("<div>Hello</div>"); //Equals null yo Why does that not work?

    Read the article

  • Regex matching wrong strings

    - by Joe Smalley
    I have this PHP/SQL query: $sql = sprintf("SELECT * FROM %sCubeCart_filemanager WHERE filepath REGEXP '%s[\\/\\\\][^\\/\\\\]+$' AND type = '%d' AND disabled = '0' ORDER BY filepath ASC %s", $this->_config['dbprefix'], str_replace(array('\\','/'),'.',$folder), $type, $limit); if '$folder' == 'iha9' it is finding results like 'iha91' and 'iha99' too. Something is wrong with the regular expression, but I don't know how they work, can anyone help?!

    Read the article

  • JavaScript: using constructor without operator 'new'

    - by GetFree
    Please help me to understand why the following code works: <script> var re = RegExp('\\ba\\b') ; alert(re.test('a')) ; alert(re.test('ab')) ; </script> In the first line there is no new operator. As far as I know, a contructor in JavaScript is a function that initialize objects created by the operator new and they are not meant to return anything.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >