Search Results

Search found 4498 results on 180 pages for 'expression'.

Page 15/180 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Convert regular expression to CFG

    - by user242581
    How can I convert some regular language to its equivalent Context Free Grammar(CFG)? Whether the DFA corresponding to that regular expression is required to be constructed or is there some rule for the above conversion? For example, considering the following regular expression 01+10(11)* How can I describe the grammar corresponding to the above RE?

    Read the article

  • Regular expression for email

    - by Nadeem
    I tried the reg expression ^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+ for the email validation. Since I want the user to allow submitting even with the empty email address. So I changed the reg ex to (^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+)? But this expression accepts any email address without any validation.

    Read the article

  • LINQ Query vs Lambda Expression

    - by FosterZ
    What is the difference between the following two snippets (i.e LINQ Query vs Lambda Expression) LINQ Query public Product GetProduct(int productID) { AdventureWorksDBDataContext db = new AdventureWorksDBDataContext(); Product product = (from p in db.Products where p.ProductID == productID select p).Single(); return product; } Using a Lambda expression public Product GetProduct(int productID) { AdventureWorksDBDataContext db = new AdventureWorksDBDataContext(); Product product = db.Products.Single(p = p.ProductID == productID); return product; }

    Read the article

  • Regular Expression to select Hyperlink

    - by Veejay
    I am using the following Expression to select all hyperlinks //a[@href] How can I write an expression to select all hyperlinks which match this format http://abc.com/articles/1 here http://abc.com/articles/ is constant and the article number increases

    Read the article

  • regular expression for string in c

    - by darkie15
    Hi All, I am working writing a regular expression used to validate string in C. Here is to what I have gone so far '^"[A-Za-z0-9]*[\t\n]*"$' for rules - A string should begin with double quotes - May not contain a newline character However, I am not able to capture the rule for allowing '\' or '"' in a string if preceded with '\'. Here is what I tried: '^"[A-Za-z0-9]*[\t\n]*[\\\|\\"]?"$' But this doesn't seem to work. What might be wrong with the regular expression here? Regards, darkie15

    Read the article

  • Remove duplicate characters using a regular expression

    - by Alex
    I need to Match the second and subsequent occurances of the * character using a regular expression. I'm actually using the Replace method to remove them so here's some examples of before and after: test* -> test* (no change) *test* -> *test test** *e -> test* e Is it possible to do this with a regular expression? Thanks

    Read the article

  • Finding Last Fired time using a Cron Expression in Java

    - by a-sak
    Is there a way in Java to find the "Last Fired Time" from a Cron Expression. E.g. If now = 25-Apr-2010 10pm, cron expression "0 15 10 ? * *" (quartz) should return me 25-Apr-2010 10:15am I do not care if we use standard cron expressions (like Unix and Quartz) or less popular ones if they can fetch me the correct "Last Fired Time"

    Read the article

  • Regular expression to retrieve everything before first slash

    - by alex
    I need a regular expression to basically get the first part of a string, before the first slash (). For example in the following: C:\MyFolder\MyFile.zip The part I need is "C:" Another example: somebucketname\MyFolder\MyFile.zip I would need "somebucketname" I also need a regular expression to retrieve the "right hand" part of it, so everything after the first slash (excluding the slash.) For example somebucketname\MyFolder\MyFile.zip would return MyFolder\MyFile.zip.

    Read the article

  • Question regarding php Regular expression filenames

    - by jason
    I am very bad at regular expressions, but I have a regular expression that is working okay, except for one issue: /\/(.*?).php/ I only need this regular expression to find things like: /this-a-valid-page.php {some words here} /anotherpage.php { some words here} http://www.google.com but do not find URLs the problem i am having is that it find this parts of full URLS i want it to avoid these all together. http://www.google.com/page.php because i have another function that does something different than the filename reg exp.

    Read the article

  • Help with Regular Expression

    - by shivesh
    Hello I need help with Regular Expression, I want to match each section (number and it's text - 2 groups), the text can be multi line, each section ends when another section starts (another number) or when .END is reached or EOF. Demo Expression: \(\d{1,3}\) ([\s\S]*?)(\.END|\(\d{1,3}\)) Input text: (1) some text some text some text some text some text some text (2) some text some textsome text (3) some textsome text some textsome textsome text (4) some text .END first group should match number (with brackets) and second group should match corresponded text.

    Read the article

  • JSTL expression evaluation from a string

    - by Venkatesh
    Is it possible to evaluate a String as EL expression in JSP and get value from it? I need an expression like ${model.${fieldPath}} where fieldPath will contain the required object path from a nested object model. I can get the actual field path by using but I am not sure how to evaluate a string and get the value from it Any help regarding this would be highly appreciated.

    Read the article

  • php Dollar amount Regular Expression

    - by Thildemar
    I am have completed javascript validation of a form using Regular Expressions and am now working on redundant verification server-side using PHP. I have copied this regular expression from my jscript code that finds dollar values, and reformed it to a PHP friendly format: /\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/ Specifically: if (preg_match("/\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/", $_POST["cost"])){} While the expression works great in javascript I get : Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 1 when I run it in PHP. Anyone have a clue why this error is coming up?

    Read the article

  • regular expression: extract last 2 characters

    - by dotnet-practitioner
    what is the best way to extract last 2 characters of a string using regular expression. For example, I want to extract state code from the following "A_IL" I want to extract IL as string.. please provide me C# code on how to get it.. string fullexpression = "A_IL"; string StateCode = some regular expression code.... thanks

    Read the article

  • How to process this string via regular expression

    - by iiduce
    my string style like this: expression1/field1+expression2*expression3+expression4/field2*expression5*expression6/field3 a real style mybe like this: computer/(100)+web*mail+explorer/(200)*bbs*solution/(300) "+" and "*" represent operator "computer","web"...represent expression (100),(200) represent field num . field num may not exist. I want process the string to this: /(100)+web*+explorer/(200)bbs/(300) rules like this: if expression length is more than 3 and its field is not (200), then add brackets to it.

    Read the article

  • regular expression for challenge value

    - by Salman
    Hi what will be the regular expression to extract challenge var value i am interested in this vlaue 03AHJ_Vut9LJLOJuCsjF9PbSSMncTyUe7Y4dHX11eRLae3LGfDZ0hSfDR7jZq2ZrKJxyC-LRSSppv72oHKaQMsd-EnoVNL6p7liTh7siN26zzTA_E2rcC_JQ15613Azz4qm8HjPtAyksUdc7QZydszwolk92hBPrAAig this value changes every time we refresh it so the expression has to be generic enough to pick up what ever is the value var RecaptchaState = { site : '6LeKCL8SAAAAADV5Dr-lfY2eOEV8rubeN25BAKp2', challenge : '03AHJ_Vut9LJLOJuCsjF9PbSSMncTyUe7Y4dHX11eRLae3LGfDZ0hSfDR7jZq2ZrKJxyC-LRSSppv72oHKaQMsd-EnoVNL6p7liTh7siN26zzTA_E2rcC_JQ15613Azz4qm8HjPtAyksUdc7QZydszwolk92hBPrAAig', is_incorrect : false, programming_error : '', error_message : '', server : 'http://www.google.com/recaptcha/api/', timeout : 18000}; any help will be appreciated, or any method to extract this value in any server side lang

    Read the article

  • Regular expression from font to span (size and colour) and back (VB.NET)

    - by chapmanio
    Hi, I am looking for a regular expression that can convert my font tags (only with size and colour attributes) into span tags with the relevant inline css. This will be done in VB.NET if that helps at all. I also need a regular expression to go the other way as well. To elaborate below is an example of the conversion I am looking for: <font size="10">some text</font> To then become: <span style="font-size:10px;">some text</span> So converting the tag and putting a "px" at the end of whatever the font size is (I don't need to change/convert the font size, just stick px at the end). The regular expression needs to cope with a font tag that only has a size attribute, only a color attribute, or both: <font size="10">some text</font> <font color="#000000">some text</font> <font size="10" color="#000000">some text</font> <font color="#000000" size="10">some text</font> I also need another regular expression to do the opposite conversion. So for example: <span style="font-size:10px;">some text</span> Will become: <font size="10">some text</font> As before converting the tag but this time removing the "px", I don't need to worry about changing the font size. Again this will also need to cope with the size styling, font styling, and a combination of both: <span style="font-size:10px;">some text</span> <span style="color:#000000;">some text</span> <span style="font-size:10px; color:#000000;">some text</span> <span style="color:#000000; font-size:10px;">some text</span> I apprecitate this is a lot to ask, I am hopeless with regular expressions and need to find a way of making these conversions in my code. Thanks so much to anyone that can/is willing to help me!

    Read the article

  • extract variables from an expression using javascript regexp

    - by powerboy
    For example, here is a string representing an expression: var str = 'total = sum(price * qty) * 1.09875'; I want to extract variables (i.e., 'total', 'price' and 'qty' but not 'sum' since 'sum' is a function name) from this expression. What is the regexp pattern in javascript? Variable name consists of letters, digits, or the underscore, beginning with letters or the underscore.

    Read the article

  • Regular Expression - Block Spam

    - by Immanuel
    Could someone lead me on finding a regular expression that blocks a comma separated list of Spam words I already have? The regular expression needs to match a string with the spam word list I already have. Not that it matters, but I am using PHP.

    Read the article

  • Regular Expression

    - by TiagoDias
    Hi all, I cannot manage to get a working regular expression (for use in ASP.NEt Validataor) for the following criteria: - I want all chars from A-Z a-z 0-9 - I don't want the Enter key I have the expression: [\w\s,.-/]*[^\n] but that don't works. Please give-me a hint, Thanks.

    Read the article

  • Regular expression that matches valid IPv6 addresses

    - by Readonly
    I'm having trouble writing a regular expression that matches valid IPv6 addresses, including those in their compressed form (with "::" or leading zeros omitted from each byte pair). Can someone suggest a regular expression that would fulfill the requirement? I'm considering expanding each byte pair and matching the result with a simpler regex.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >