Search Results

Search found 3956 results on 159 pages for 'regex cookbook'.

Page 1/159 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Regular Expressions Cookbook Ebook Deal of the Day

    - by Jan Goyvaerts
    Every day O’Reilly has an “ebook deal of the day” offering one or a bunch of their books in electronic format for only $9.99. Twice this year I received an email from O’Reilly notifying me that Regular Expressions Cookbook was on sale. But each time the email was sent on the morning of the day itself. When it’s morning in California it’s already bedtime for me here in Thailand. So I never saw the emails until the next day, making it rather pointless to blog about the deal. But this time O’Reilly has listened to my request for advance notification. I just got an email this morning saying Regular Expressions Cookbook will be part of the Ebook Deal of the Day for 15 September 2010. That’s 15 September on the US west coast. When I write this there’s a few hours to go before the deal starts at one past midnight California time. You can get any O’Reilly Cookbook as an ebook for only $9.99. The normal price for Regular Expressons Cookbook as an ebook is $31.99. The download includes the book in PDF, ePub, Mobi (for Kindle), DAISY, and Android formats.

    Read the article

  • Microsoft SQL Server 2008 R2 Administration Cookbook

    - by ssqa.net
    Its one year on my first book released, keeping aside the financial gains from this book I'm more happy to achieve one of the important goals from my career. This is something big in my life to announce, it gives immensive pleasure and happiness to share about my first book (hard paper) and eBook release, titled : Microsoft SQL Server 2008 R2 Administration Cookbook is released and out now. share my experience and task based real-world best practices in a cookbook style. My thanks to the technical...(read more)

    Read the article

  • What’s New in The Second Edition of Regular Expressions Cookbook

    - by Jan Goyvaerts
    %COOKBOOKFRAME% The second edition of Regular Expressions Cookbook is a completely revised edition, not just a minor update. All of the content from the first edition has been updated for the latest versions of the regular expression flavors and programming languages we discuss. We’ve corrected all errors that we could find and rewritten many sections that were either unclear or lacking in detail. And lack of detail was not something the first edition was accused of. Expect the second edition to really dot all i’s and cross all t’s. A few sections were removed. In particular, we removed much talk about browser inconsistencies as modern browsers are much more compatible with the official JavaScript standard. There is plenty of new content. The second edition has 101 more pages, bringing the total to 612. It’s almost 20% bigger than the first edition. We’ve added XRegExp as an additional regex flavor to all recipes throughout the book where XRegExp provides a better solution than standard JavaScript. We did keep the standard JavaScript solutions, so you can decide which is better for your needs. The new edition adds 21 recipes, bringing the total to 146. 14 of the new recipes are in the new Source Code and Log Files chapter. These recipes demonstrate techniques that are very useful for manipulating source code in a text editor and for dealing with log files using a grep tool. Chapter 3 which has recipes for programming with regular expressions gets only one new recipe, but it’s a doozy. If anyone has ever flamed you for using a regular expression instead of a parser, you’ll now be able to tell them how you can create your own parser by mixing regular expressions with procedural code. Combined with the recipes from the new Source Code and Log Files chapter, you can create parsers for whatever custom language or file format you like. If you have any interest in regular expressions at all, whether you’re a beginner or already consider yourself an expert, you definitely need a copy of the second edition of Regular Expressions Cookbook if you didn’t already buy the first. If you did buy the first edition, and you often find yourself referring back to it, then the second edition is a very worthwhile upgrade. You can buy the second edition of Regular Expressions Cookbook from Amazon or wherever technical books are sold. Ask for ISBN 1449319432.

    Read the article

  • Second Edition of Regular Expressions Cookbook Has Been Published

    - by Jan Goyvaerts
    %COOKBOOKFRAME% The first edition of Regular Expressions Cookbook was published in May of 2009. It quickly became a bestseller, briefly holding the #1 spot in computer books on Amazon.com. It also had staying power. The ebook version was O’Reilly’s top seller during the whole year of 2010. So it’s no surprise that our editor at O’Reilly soon contacted us for a second edition. With Steven and I always being very busy, those plans were delayed until finally both of us found the time to update the book. Work started in January. Today you can buy your own copy of the second edition of Regular Expressions Cookbook. O’Reilly’s online shop sells the eBook in DRM-free ePub, Mobi, and PDF formats for $39.99 and the print version for $49.99. These are the list prices for the eBook and the print book. If you’re looking for a discount and free shipping of the print book, you can pre-order on one of the various Amazon sites. Deliveries should start soon. The discount rates differ and are subject to change. Amazon will also pay me an affiliate commission if you use one of these links, which pretty much doubles the income I get from the book. Amazon.com. Free shipping to the USA. Amazon.co.uk. Free shipping to the UK and Ireland. Amazon.fr. Free shipping to France, Monaco, Luxembourg, and Belgium. Amazon.de. Free shipping to Germany, Austria, Switzerland, Luxembourg, Liechtenstein, Belgium, and The Netherlands. If you don’t want to wait for the print book to arrive, the Kindle edition is already available for instant delivery. The Kindle edition works on Amazon’s Kindle hardware, and on PCs via Amazon’s Kindle software (free download). Amazon.com Amazon.co.uk Amazon.fr Amazon.de I’ll blog more about the book in the coming days and weeks with details about what’s new in the second edition.

    Read the article

  • Second Edition of Regular Expressions Cookbook Now In Stock at Amazon.com

    - by Jan Goyvaerts
    %COOKBOOKFRAME% The second edition of Regular Expressions Cookbook is now in stock as a printed book Amazon.com. Right now, the printed book is discounted 45% to $27.51, which is actually more than a dollar cheaper than the Kindle edition. The European Amazon sites don’t have the printed book in stock yet. But it shouldn’t take too long for the book to make it from the US to Europe. They do have the Kindle edition.

    Read the article

  • Regular Expressions Cookbook Is in The Money—Win a Copy

    - by Jan Goyvaerts
    %COOKBOOKFRAME%You may have heard some people say that most book authors never get any royalties. That’s not true because most authors get an advance royalty that is paid before the book is published. That’s the author’s main incentive for writing the book, at least as far as money is concerned. (If money is your main concern, don’t write books.) What is true is that most authors never see any money beyond the advance royalty. Royalty rates are very low. A 10% royalty of the publisher’s price is considered normal. The publisher’s price is usually 45% of the retail price. So if you pay full price in a bookstore, the author gets 4.5% of your money. If there’s more than one author, they split the royalty. It doesn’t take a math degree to figure out that a book needs to sell quite a few copies for the royalty to add up to a meaningful amount of money. But Steven and I must have done something right. Regular Expressions Cookbook is in the money. My royalty statement for the 3rd quartier of 2009, which is the 2nd quarter that the book was on the market, came with a check. I actually received it last month but didn’t get around to blogging about. The amount of the check is insignificant. The point is that the balance is no longer negative. I’m taking this opportunity to pat myself and my co-author on the back. To celebrate the occassion O’Reilly has offered to sponsor a give-away of five (5) copies of Regular Expressions Cookbook. These are the rules of the game: You must post a comment to this blog article including your actual name and actual email address. Names are published, email addresses are not. Comments are moderated by myself (Jan Goyvaerts). If I consider a comment to be offensive or spam it will not be published and not be eligible for any prize. If you don’t know what to say in the comment, just wish me a happy 100000nd birthday, so I don’t have to feel so bad about entering the 6-bit era. Each person commenting has only one chance to win, regardless of the number of comments posted. O’Reilly will be provided with the names and email addresses of the winners (and those email addresses only) in order to arrange delivery. Each winner can choose to receive a printed copy or ebook (DRM-free PDF). If you choose the printed book, O’Reilly pays for shipping to anywhere in the world but not for any duties or taxes your country may impose on books imported from the USA. If you choose the ebook, you’ll need to create an O’Reilly account that is then granted access to the PDF download. You can make your choice after you’ve won, so it doesn’t influence your chance of winning. Contest ends 28 February 2010, GMT+7 (Thai time). Chosen by five calls to Random(78)+1 in Delphi 2010, the winners are: 48: Xiaozu 45: David Chisholm 19: Miquel Burns 33: Aaron Rice 17: David Laing Thanks to everybody who participated. The winners have been notified by email on how to collect their prize.

    Read the article

  • Regular Expressions Cookbook Code Samples

    - by Jan Goyvaerts
    %COOKBOOKFRAME% One of the common criticisms against the first edition was that we didn’t have the regular expressions and code samples available for download. Since our book only has very short code snippets rather than complete programs, we (the authors) did not have these available as separate files either. But for the second edition we’re trying to do better. You can now download the code samples from the 2nd edition of Regular Expressions Cookbook. This HTML file contains all the blocks with regular expressions and source code from the book, along with the titles of the chapters, recipes, and sections that they are found in. If you have purchased the book, you can use this file to easily copy and paste the regular expressions and source code snippets. Even if you purchased the ebook, you may prefer to use this file. The regexes in the ebook are formatted with line breaks and gray dots for spaces to make them easier to read in print. The HTML file does not use such formatting, so you can copy and paste them directly. This means that some very regexes will run beyond the edge of your browser window.

    Read the article

  • c# RegEx with "|"

    - by WtFudgE
    I need to be able to check for a pattern with | in them. For example an expression like d*|*t should return true for a string like "dtest|test". I'm no regex hero so I just tried a couple of things, like: Regex Pattern = new Regex("s*\|*d"); //unable to build because of single backslash Regex Pattern = new Regex("s*|*d"); //argument exception error Regex Pattern = new Regex(@"s*\|*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex(@"s*|*d"); //argument exception error Regex Pattern = new Regex("s*\\|*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex("s*" + "\\|" + "*d"); //returns true when I use "dtest" as input, so incorrect Regex Pattern = new Regex(@"s*\\|*d"); //argument exception error I'm a bit out of options, what should I then use? I mean this is pretty basic RegEx i know, but I'm not getting it for some reason.. Thx

    Read the article

  • Make a Perl-style regex interpreter behave like a basic or extended regex interpreter

    - by Barry Brown
    I am writing a tool to help students learn regular expressions. I will probably be writing it in Java. The idea is this: the student types in a regular expression and the tool shows which parts of a text will get matched by the regex. Simple enough. But I want to support several different regex "flavors" such as: Basic regular expressions (think: grep) Extended regular expressions (think: egrep) A subset of Perl regular expressions, including the character classes \w, \s, etc. Sed-style regular expressions Java has the java.util.Regex class, but it supports only Perl-style regular expressions, which is a superset of the basic and extended REs. What I think I need is a way to take any given regular expression and escape the meta-characters that aren't part of a given flavor. Then I could give it to the Regex object and it would behave as if it was written for the selected RE interpreter. For example, given the following regex: ^\w+[0-9]{5}-(\d{4})?$ As a basic regular expression, it would be interpreted as: ^\\w\+[0-9]\{5\}-\(\\d\{4\}\)\?$ As an extended regular expression, it would be: ^\\w+[0-9]{5}-(\\d{4})?$ And as a Perl-style regex, it would be the same as the original expression. Is there a "regular expression for regular expressions" than I could run through a regex search-and-replace to quote the non-meta characters? What else could I do? Are there alternative Java classes I could use?

    Read the article

  • Recommendation for Regex editor?

    - by Tim
    I asked for recommendations for Regex editors on stackoverflow a while ago. Following is one of the replies: What is "good" depends on what is most useful to you. For me, though, these are the key features for a good regex editor (besides the ability to test and create regular expressions, of course, which is a prerequisite to be called a "regex editor" :-) : Displays matches hierarchically with captured groups. Explains/analyzes an entered regex in plain English, showing a hierarchical tree. Translates your regex into code for a language of your choice. RegexBuddy, as @Max mentioned, does all these but there is also a free alternative, Expresso that also does them very well. These two utilities are the only ones I have found with the crucial ability to explain a regex. The features sound very attractive to me. But later I found the two are for Windows. I tried to install Expresso, the free one, via Wine, but met some trouble, about which I asked in another post. So I was wondering if in Ubuntu there are some applications comparable to RegexBuddy and Expresso? If it is required to install .NET Framework in order to install Expresso, is it still worth to install Expresso on Ubuntu? Thanks and regards!

    Read the article

  • How to negate the whole regex?

    - by 01
    I have a regex, for example ([m]{2}|(t){1}). It matches ma and t and doesn't match bla. I want to negate the regex, thus it must match bla and not ma and t, by adding something to this regex. I know I can write bla, the actual regex is however more complex.

    Read the article

  • c# Regex trouble

    - by Shannow
    Hi there, I'm having a bit of trouble with my regex. String a = @"{target=}jump"; String b = "continue"; String c = "jump"; String d = @"{target=intro}jump"; String e = "prev"; String f = @"{target=}choice"; String g = @"{target=intro}choice"; String h = "choice"; String i = "previous"; String j = @"{target=intro}continue"; String k = "cont"; String l = @"{target=}continue"; Regex regex = new Regex(@"(^{target=(\w.*)}(choice|jump))|(^[^.]*(continue|previous))"); var a_res = regex.IsMatch(a); var b_res = regex.IsMatch(b); var c_res = regex.IsMatch(c); var d_res = regex.IsMatch(d); var e_res = regex.IsMatch(e); var f_res = regex.IsMatch(f); var g_res = regex.IsMatch(g); var h_res = regex.IsMatch(h); var i_res = regex.IsMatch(i); var j_res = regex.IsMatch(j); var k_res = regex.IsMatch(k); var l_res = regex.IsMatch(l); Basically what i need is to get a match when choice or jump is present that it is proceeded by {target= } with any number of characters after the =. And also to match if continue or previous are present but only if they are proceeded by nothing. so A = false, b = true, c = false, d = true, e = false, f = false, g = true, h = false, i = true, j = false, k = false and l = false, with my regex above I get correct reading for everything bar j and l. Can anyone please help?

    Read the article

  • Building a regex builder

    - by i.h4d35
    I am a beginner in programming in general and web development in particular. I am especially bad at regular expressions. Recently I was involved in building a couple of cPanel plugins(Perl-CGI) and that's when I realized how bad I am in regex. As a result, I have decided to build an online regex builder - this will help me to learn regex and help other struggling with regex. I have checked out GSkinner, Rubular and a couple of others like regexpal. It seemed to be a little difficult to use, hence i thought of writing another one. I do not know which tool is best suited for the job. should I write it in Perl or Python? My skill level is between beginner and intermediate in both those languages. What would be a good starting point - building it for the CLI or for the browser? I plan to get a string as an input, ask if the user want to search or search and replace, enter the search string (and the replace string where applicable) and then generate a regex. Would this be the right way to go?

    Read the article

  • how to negate whole regex ??

    - by 01
    I have regex (for example) ([m]{2}|(t){1}) and it matches ma and t and doesnt match bla I want it to match bla and doesnt match ma and t by adding something to this regex, i know i can write bla, my real-life regex is more complex.

    Read the article

  • Why is negation of a regex needed?

    - by Lazer
    There are so many questions on regex-negation here on SO. I am not sure I understand why people feel the need to negate a regex. Why not use something like grep -v that shows only the results that do not match the regex? $ ls april august december february january july june march may november october september $ ls | grep ber december november october september $ ls | grep -v ber april august february january july june march may

    Read the article

  • Regex to match a whole string only if it lacks a given substring/suffix

    - by Ivan Krechetov
    I've searched for questions like this, but all the cases I found were solved in a problem-specific manner, like using !g in vi to negate the regex matches, or matching other things, without a regex negation. Thus, I'm interested in a “pure” solution to this: Having a set of strings I need to filter them with a regular expression matcher so that it only leaves (matches) the strings lacking a given substring. For example, filtering out "Foo" in: Boo Foo Bar FooBar BooFooBar Baz Would result in: Boo Bar Baz I tried constructing it with negative look aheads/behinds (?!regex)/(?<!regex), but couldn't figure it out. Is that even possible?

    Read the article

  • Use RegEx in Java to extract parameters in between parentheses

    - by lars_bx
    I'm writing a utility to extract the names of header files from JSPs. I have no problem reading the JSPs line by line and finding the lines I need. I am having a problem extracting the specific text needed using regex. After looking at many similar questions I'm hitting a brick wall. An example of the String I'll be matching from within is: <jsp:include page="<%=Pages.getString(\"MY_HEADER\")%>" flush="true"></jsp:include> All I need is MY_HEADER for this example. Any time I have this tag: <%=Pages.getString I need what comes between this: <%=Pages.getString(\" and this: )%> Here is what I have currently (which is not working, I might add) : String currentLine; while ((currentLine = fileReader.readLine()) != null) { Pattern pattern = Pattern.compile("<%=Pages\\.getString\\(\\\\\"([^\\\\]*)"); Matcher matcher = pattern.matcher(currentLine); while(matcher.find()) { System.out.println(matcher.group(1).toString()); }} I need to be able to use the Java RegEx API and regex to extract those header names. Any help on this issue is greatly appreciated. Thanks! EDIT: Resolved this issue, thankfully. The tricky part was, after being given the right regex, it had to be taken into account that the String I was feeding to the regex was always going to have two " / " characters ( (/"MY_HEADER"/) ) that needed to be escaped in the pattern. Here is what worked (thanks to the help ;-)): Pattern pattern = Pattern.compile("<%=Pages\\.getString\\(\\\\\"([^\\\\\"]*)");

    Read the article

  • Boost Regex unknown number of var

    - by Katrin Thielmann
    I got a Problem with a regex expression and need help. I have some expressions like these in mein .txt File: 19 = NAND (1, 19) regex expression : http://rubular.com/r/U8rO09bvTO With this regex expression i got seperated matches for the numbers. But now I need a regex expression with a unknown size of numbers in the bracket . For example: 19 = NAND (1, 23, 13, 24) match1: 19 match2: 1 match3: 23 match4: 13 match5: 24 I don't know the number of the numbers. So i need a main expression for min 2 numbers in the bracket till a unknow number. I hope somebody can help me.

    Read the article

  • Regex to leave desired string remaining and others removed

    - by m7d
    In Ruby, what regex will strip out all but a desired string if present in the containing string? I know about /[^abc]/ for characters, but what about strings? Say I have the string "group=4&type_ids[]=2&type_ids[]=7&saved=1" and want to retain the pattern group=\d, if it is present in the string using only a regex? Currently, I am splitting on & and then doing a select with matching condition =~ /group=\d/ on the resulting enumerable collection. It works fine, but I'd like to know the regex to do this more directly.

    Read the article

  • Haskell: 'No instance for' arising from a trivial usage of Regex library

    - by artemave
    Following the (accepted) answer from this question, I am expecting the following to work: Prelude Text.Regex.Posix Text.Regex.Base.RegexLike Text.Regex.Posix.String> makeRegex ".*" (makeRegex is a shortcut for makeRegexOpts with predefined options) However, it doesn't: <interactive>:1:0: No instance for (RegexMaker regex compOpt execOpt [Char]) arising from a use of `makeRegex' at <interactive>:1:0-13 Possible fix: add an instance declaration for (RegexMaker regex compOpt execOpt [Char]) In the expression: makeRegex ".*" In the definition of `it': it = makeRegex ".*" Prelude Text.Regex.Posix Text.Regex.Base.RegexLike Text.Regex.Posix.String> make Regex ".*"::Regex <interactive>:1:0: No instance for (RegexMaker Regex compOpt execOpt [Char]) arising from a use of `makeRegex' at <interactive>:1:0-13 Possible fix: add an instance declaration for (RegexMaker Regex compOpt execOpt [Char]) In the expression: makeRegex ".*" :: Regex In the definition of `it': it = makeRegex ".*" :: Regex And I really don't understand why. EDIT Haskell Platform 2009.02.02 (GHC 6.10.4) on Windows EDIT2 Prelude Text.Regex.Base.RegexLike Text.Regex.Posix.String> :i RegexMaker class (RegexOptions regex compOpt execOpt) => RegexMaker regex compOpt execOpt source | regex -> compOpt execOpt, compOpt -> regex execOpt, execOpt -> regex compOpt where makeRegex :: source -> regex makeRegexOpts :: compOpt -> execOpt -> source -> regex makeRegexM :: (Monad m) => source -> m regex makeRegexOptsM :: (Monad m) => compOpt -> execOpt -> source -> m regex -- Defined in Text.Regex.Base.RegexLike

    Read the article

  • Using ModalAlert from cookbook - app does not load

    - by user127091
    I'm using iphone cookbook code to prompt a user for text in a UIAlertView. The cookbook code is available at http://github.com/erica/iphone-3.0-cookbook-/tree/master/C10-Alerts/03-Soliciting%20Text/ In my AppDelegate, applicationDidFinishLaunching(), I invoke as below NSString *str = [ModalAlert ask:@"what is your name?" withTextPrompt:@"ATTUID"]; But my app does not finish loading at all. I get a black screen indefinitely. There are no messages in the console. I tried creating just a UIAlertView with UITextField in the above function and it displays properly. (commenting out her code) Commenting out "CFRunLoopRun()" also loads the app. I'm probably doing something stupid but can't seem to figure it out.

    Read the article

  • OWASP Regex Repository: Is this regex correct?

    - by Jacco
    I was looking at the regular expression for validating various data types from the (OWASP Regex Repository). One of the regular expressions in there is called safetext and looks like: ^[a-zA-Z0-9\s.\-]+$ My first question is: Is this regular expression correct? complementary question If this Regex Repository any good at all?

    Read the article

  • regex return conditional group

    - by priyank.mp
    Hi , I spent lot time figuring out a simple regex to return a group (only 1st group). So the string can be - "No purchase required" or "Purchase of $50.00 worth groceries is required." I am trying to write a regex which can parse "No" or "50" based on the given string. This is what I have written. (?:(No) monthly maintenance|Purchase of \$([\d\.]+ worth groceries) This works fine but I want my output as 1st group/group 1 only.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >