BNF to regular Expressions
How can I describe the language A → AA | ( A ) | ε generates using regular expressions? ...
How can I describe the language A → AA | ( A ) | ε generates using regular expressions? ...
I.e. the match of He said, "For my part, it was Greek to me. " should be For my part, it was Greek to me. Without the trailing space. I've tried \"\s*([^\"]*)\s*\" but it's always matching trailing whitespaces in the group. ...
I need a Regex Statement (run in c#) that will take a string containing a Sql Update statement as input, and will return a list of columns to be updated. It should be able to handle columns surrounded by brackets or not. // Example Sql Statement Update Employees Set FirstName = 'Jim', [LastName] = 'Smith', CodeNum = codes.Num From Empl...
I have a project (private, ASP.net website, password protected with https) where one of the requirements is that the user be able to enter Sql queries that will directly query the database. I need to be able to allow these queries, while preventing them from doing damage to the database itself, and from accessing or updating data that th...
I'm trying to create a Regex to block all < and > in a String except when used with <select>. Can anyone suggest a Regex for that? I'll be using it with javax.util.Pattern. I'm trying to write a solution to block the injection attack and XSS attempts through request and URL. For that, I'll be blocking the special characters and charact...
Hi, I'm confused about the regex librarys that can be available for the iphone. For example RegexLite look like need a dinamyc link, nad as I understood this is not possible for the sdk on the iPhone. I wanna a regex library for do data validation... which one is the best available? ...
I need to search through an html doc, find all of the spans and delete the spans and everything between them. What would a regular expression look like that would match everything between ? ...
Hi, i write program that parse text with regular expression. Regular expression should be obtained from user. I deside to use glob syntax for user input, and convert glob string to the regular expression internally. For example: "foo.? bar*" should be converted to "^.*foo\.\w\bar\w+.*" Somehow, i need to escape all meaningful cha...
Please tell me how to check regular expression for no blank space b/w text. ...
Here's a sample string which I want do a regex on 101-nocola_conte_-_fuoco_fatuo_(koop_remix) The first digit in "101" is the disc number and the next 2 digits are the track numbers. How do I match the track numbers and ignore the disc number (first digit)? ...
Hi, One of the biggest annoyances I find in Python is the inability of the re module to save its state without explicitly doing it in a match object. Often, one needs to parse lines and if they comply a certain regex take out values from them by the same regex. I would like to write code like this: if re.match('foo (\w+) bar (\d+)', li...
How can I test if a regex matches a string exactly? var r = /a/; r.test("a"); // returns true r.test("ba"); // returns true testExact(r, "ba"); // should return false testExact(r, "a"); // should return true ...
I've got a bunch of first names in a field that carry a middle initial with a '.' at the end..I need a regex to convert this example:Kenneth R.intoKennethI was trying to build my own and found this useful site btw..http://www.gskinner.com/RegExr/but I'm new to Perl & regular expressions and could only get "...$" - which is useless when t...
I have a problem. I'd like to match all occurrences of \t in my text (and by \t i mean it literally it is not a tab character) but I would like to exclude a match if it is a part of \t string. How to do that? Example <HTML>Blah</HTML>\t D:\\UserData\\tui I'd like to match \t in the first line but not in second line (as it is a part o...
I want to write a regex that matches if a string contains XYZ but doesn't contain ABC somewhere before it. So "blah XYZ blah" should match, but "blah ABC blah XYZ blah " should not. Any ideas? In particular I'm writing the regex in c#, in case there's anything specific to that syntax. I guess I can use negative lookbehind but haven't u...
Scenario: I have a text file that has pipe (as in the "|" character) delimited data. Each field of data in the pipe delimited fields can be of variable length, so counting characters won't work (or using some sort of substring function... if that even exists in VIM). Is it possible, using VIM / Vi to delete all data from the second p...
I'm writing some code that handles logging xml data and I would like to be able to replace the content of certain elements (eg passwords) in the document. I'd rather not serialize and parse the document as my code will be handling a variety of schemas. Sample input documents: doc #1: <user> <userid>jsmith</userid> <p...
I need a generic transliteration or substitution regex that will map extended latin characters to similar looking ASCII characters, and all other extended characters to '' (empty string) so that... é becomes e ê becomes e á becomes a ç becomes c Ď becomes D and so on, but things like ‡ or Ω or ‰ just get striped away. ...
Hi, I am trying to write a pattern for extracting the path for files found in img tags in HTML. String string = "<img src=\"file:/C:/Documents and Settings/elundqvist/My Documents/My Pictures/import dialog step 1.JPG\" border=\"0\" />"; My Pattern: src\\s*=\\s*\"(.+)\" Problem is that my pattern will also include the 'border="0" p...
Duplicate: http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses There seem to be an awful lot of different variants on this on the web and was wondering if there is a definitive answer? Preferably using the .net (Regex) dialog of regular expressions. ...