Search Results

Search found 6394 results on 256 pages for 'regular expressions'.

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

  • Determining whether values can potentially match a regular expression, given more input

    - by Andreas Grech
    I am currently writing an application in JavaScript where I'm matching input to regular expressions, but I also need to find a way how to match strings to parts of the regular expressions. For example: var invalid = "x", potentially = "g", valid = "ggg", gReg = /^ggg$/; gReg.test(invalid); //returns false (correct) gReg.test(valid); //returns true (correct) Now I need to find a way to somehow determine that the value of the potentially variable doesn't exactly match the /^ggg$/ expression, BUT with more input, it potentially can! So for example in this case, the potentially variable is g, but if two more g's are appended to it, it will match the regular expression /^ggg$/ But in the case of invalid, it can never match the /^ggg$/ expression, no matter how many characters you append to it. So how can I determine if a string has or doesn't have potential to match a particular regular expression?

    Read the article

  • What is the regular expression for valdating a 'price' in a jtextfield

    - by wniroshan
    I want to validate a jtextfield as user inputs a price of some item. I have a perfectly working code which beeps and discard if user inputs some character that doesnt match the regular expression.(for regular expression "[0-9]+" it accepts any number of digits and beeps if a letter is given as input) But the problem is I want to validate an input like "12500.00". Format should be any number of digits before decimal point and two digits after the decimal point. eg: ddd.dd I tried the following regular expression. But the i doesnt allow user to input "." character. It allows user to input any number of digits but when "." key is pressed input is not accepted. here is the regular expression I used. "[0-9]+ | [0-9]+. | [0-9]+.[0-9]{1} | [0-9]+{2}" important: user input is validated character by character as the user inputs them to the jtextfield.

    Read the article

  • ASP.NET, JQuery - Sharing regular expressions

    - by Steve
    If you have a fair number of regular expressions used by both client (javascript) and server side code (C#, vb.net) and want to store them in one place to avoid duplication, where do you store them? I could use registerscript and write out the regex as strings, but just wondering if there is something more elegant.

    Read the article

  • 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

  • Can I use relative XPath expressions in libxml2?

    - by brbr
    I am wondering whether it is possible to use relative XPath expressions in libxml2. This is from the javax.xml.xpath API and I would like to do the similar thing using libxml2: Node widgetNode = (Node) xpath.evaluate(expression, document, XPathConstants.NODE); With a reference to the element, a relative XPath expression can now written to select the child element: XPath xpath = XPathFactory.newInstance().newXPath(); String expression = "manufacturer"; Node manufacturerNode = (Node) xpath.evaluate(expression, **widgetNode**, XPathConstants.NODE);

    Read the article

  • Regular expression to validate name in .NET multilingual web application

    - by BT
    Hi, how can i write a regular expression to validate name field in a multilingual web application, i want to validate the name field for non-English languages e.g. Spanish or German, and we need to make sure that no one enter digits or special characters. I'm using .NET. I believe we can't use expression as below for non-English language. ^[a-zA-Z]{1,20}$ Any help will be highly appreciated! Solution: I'm using this regular expression ^\p{L}[\p{L}\p{Pd}\x27]*\p{L}$ , and the below MSISDN article was very helpful: MSDN - Regular Expression Also below tool is very helpful, in validating your regular expression: Regex Builder

    Read the article

  • string directly before with regular expressions?

    - by acidzombie24
    I have been given a file that has its string like this blah blah DUMMY blah blah DUMMY blah blah VALUE blahX blahY KEY Some values/keys are optional, i cannot depend on order. With regular expressions using C# how do i write an regex that takes the value directly behind the key? I know i could write it in such a way it will match the first DUMMY but i cant think of how to make the VALUE instead.

    Read the article

  • Using GWT to output XML, JSON and regular HTML

    - by Artem
    Sorry, this is a very basic question, as we are just getting started with exploring GWT. We would like to know if it's easy and possible to get GWT to "output" XML, JSON and regular HTML. I would like to know this because ideally we would port parts of our backends over slowly, and it would be nice to drop in GWT in place of AJAX wherever we need it during the transition period. Places that we would like to be able to use: 1) We have a pure XML page that we return to our client (mobile) app and right now this is handled through Spring MVC with a nice template. What's the best replacement for this? 2) We have a regular AJAX page that makes async requests and expects replies in JSON. Can we easily replace this backend? 3) We have some regular webpages where we use templates to output them, and we would like to first switch them over in the simplest possible way, without converting them to the regular GWT UI framework. Thanks!

    Read the article

  • Learning Regular Expressions

    - by Teifion
    I already know the basics of RegEx but I'm not sure where to go from here, I'm looking for both a good and above all easy to understand guide but I am also looking for things to use RegEx's for, it's all well and good reading about it but if you never use them then they will not stick in your mind. I have already found regular-expressions.info but I'm sure there are more.

    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

  • Linq Queries converting to lambda expressions ?

    - by Freshblood
    Hello from item in range where item % 2 ==0 select i ; is converting to lamda expressions as below range.where(item % 2 ==0).select(x=>x). I feel that first way of linq is translating next one and if it is ,so is there any optimization like this range.where(item & 2 == 0) instead of other one ?

    Read the article

  • Reverse regular expressions to generate data

    - by Anton Gogolev
    In one of the StackOverflow Podcasts (the one where guys were discussing data generation for testing DBs -- either #11 or #12), Jeff mentioned something like "reverse regular expressions", which are used exactly for that purpose: given a regex, produce a string which will eventually match said regex. What is the correct term for this whole concept? Is this a well-known concept?

    Read the article

  • Alter Regular Expression to Return 2 Values Instead of 3 from userAgent String

    - by Jay
    I've taken a regular expression from jQuery to detect if a browser's engine is WebKit and gets it's version number, it returns 3 values extracted from the userAgent string: webkit/….…, webkit and ….… [“….…” being the version number]. I would like the regular expression to return just 2 values: webkit and ….…. I'm rubbish at regular expressions, so please can you give an explanation of the expression with your answer. The regular expression I'm currently working with and wish to improve is: /(webkit)[\/]([\w.]+)/. I appreciate all your help, thanks in advance!

    Read the article

  • Regular expression required

    - by KhanS
    I have a regular expression "^[a-zA-Z+#-.0-9]{1,5}$" which validates that the word contains alpha-numeric characters and few special characters and length sould not be more than 5 characters. How do I make this regular expression to accept a maximum of five words matching the above regular expression.

    Read the article

  • ANTLR expressions rewrite intermediate tree

    - by user313856
    For expressions like 3+4 I would like to use the value 7 in an intermediate representation tree. I cannot work out how to get the returns value into a rewrite rule. expression returns [int v]: etc. How do I get expression.v into WR? At the moment I get (+ 3 4), I want (7) |^( WRITE c=expression) - ^(WRINT ^(INTC ^($c)) the next step is to emit 7 in an assembler.

    Read the article

  • Lambda Expressions for a 5th Grader

    - by Randy Minder
    If you had to explain Lambda expressions to a 5th grader, how would you do it? And what examples might you give, or resources might you point them to? I may be finding myself in the position of having to teach this to 5th grade level developers and could use some assistance. Thanks very much.

    Read the article

  • regular expressions for class name

    - by user576701
    i need a regular expressions string to get all anchor tags in a page with a specific css class name, in c#/vb.net this is what i got so far "<a.*?href=""(.*?)"".*?>(.*?)</a>" but my attempts to add "class=name" isnt working, also is it possible to find links where the class name appears either before or after the href with one expression ? i am familiar with 3rd party html libraries, but thats an overkill for what i have in mind, so is the webbrowser control.

    Read the article

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