regex

Regex - PHP :: Regex pattern to parse links and images from html page

Possible Duplicates: How do I extract HTML content using Regex in PHP RegEx match open tags except XHTML self-contained tags Hi, I dont know regex, i working with PHP (possible use Zend framework) I need to get from html page images and links. I think the best way to do it with regex, regex pattern that insert images and ...

Regular Expression Validator does not validate empty textbox

I would like to validate the textbox for specific text and it must not be blank. But the regular expression validator is not validating if the text box is BLANK. However, it validates if I type something in the text box. How can I make regular expression to trigger even if the text box is empty? Should I use Required Validator + ...

lexical analyse or series of regular expressions to parse unstructured text into structured form

I am trying to write some code that will function like google calendars quick add feature . You know the One where you can input any of the following : 1) 24th sep 2010 , Johns Birthday 2) John's Birthday , 24/9/10 3) 24 September 2010 , Birthday of John Doe 4) 24-9-2010 : John Does Birthday 5) John Does Birthday 24th of September 2010 ...

Case sensitive RLIKE

Consider a table datatbl like this: +----------+ | strfield | +----------+ | abcde | | fgHIJ | | KLmno | +----------+ I want to write a query something like this: select * from datatbl where strfield rlike '[a-z]*'; As in a non-SQL regex, I'd like to return the row w/ abcde, but not the rows w/ capitals. I cannot seem to f...

how to optimize a wordlist for the english language

i'm looking to optimize a wordlist for the english language using sed or a similar linux application.. in order to do this i need to: Remove lines containing anything except a-z, 0-9, or special characters Remove urls - maybe detection of the "\" character Remove lines over 16 characters long, and 4 characters or shorter. (5-16 chars...

Position of first word of string in Javascript

I originally used indexOf to find a space but I want to find any word boundary. Something like this, but what regex? var str = "This is a sentence", firstword = str.search(""); return word; I want to return "This". Even in the case of a tab, period, comma, etc. ...

regular expression: a line of string contains only float numbers and tab/spaces

what the regular expression of a line of string containing ONLY float numbers separated with spaces or tabs. The float number can be negative, like -999.999 ...

removing unwanted text

Possible Duplicate: removing unwanted text I want to remove extra text: test is like that www.abc.com dsfkf ldsf <[email protected]> I want to get only the email text in C# ...

PHP Preg (regex) extracting last value from a string? not as simple as I thought

I'm trying to use PHP preg to extract the integer at the end of the string below, in the example its "4", but could be any number coming after "INBOX/", also the "[email protected]" is a variable so it could be any address STRING I'M EXTRACTING FROM: /m/[email protected]/folder/INBOX/4 /STRING I've been going in c...

regex for date dd.MM.yyyy ?

anybody can help me with a regex for Date in this format dd.MM.yyyy I want to use it with a dataannotation like this [RegularExpression(@"theregex")] public DateTime Date {get;set;} ...

How to remove the probable dot at the beginning/end of string in PHP?

I tried this: echo preg_replace('/[^,,$]/', '', ',test,hi,'); But gets: ,,, ...

How do I write a regular expression for these path expressions.

Hi, I'm trying to write a helper method that breaks down path expressions and would love some help. Please consider a path pattern like the following four (round brackets indicate predicates): item.sub_element.subsubelement(@key = string) ; or, item..subsub_element(@key = string) ; or, //subsub_element(@key = string) ; or, item(@key =...

How do I prevent exclamations via a regex

public static final String REGEX_ADDRESS_ZIP = "^[0-9\\ -.]+$"; The above regex for validating zip code seems to allow exclamation (!) even though I haven't allowed it here. Not sure what the mistake is? Do I need to change the regex pattern ...

regular expression for physical path

can someone tell me the javascript regular expression for physical path like 1) User Should enter something like this in the textbox( c://Folder1/) . Maybe in d: or e: 2) But after that acceptable a) (c://Folder1/Folder2/) b) (d://Folder1/Folder2/Folder3/abc.txt) e) (c://Folder1/Folder2/Folder3/abc.txt) ...

C# : Regular Expression

How can i parse the following Content? data (DIR1:input bit; DGG2:input bit; OENEG1:input bit; OE_NEG2:input bit; A1:inputoutput bit_vector(1 to 9); A2,H5,J7:inputoutput bit_vector(1 to 9); B1,E4,Y7:inputoutput bit_vector(1 to 9); B2:inputoutput bit_vector(1 to 9); TGY:output bit...

asp.net mvc dataannotation spacing issue

this is my group annotation attributes [RegularExpression(@"^[a-zA-Z0-9 _]*$", ErrorMessage = "Cannot Contains other characters ")] public string vcr_GroupName { get; set; } i want to allow only two spaces in my textbox in regular expression ,how would i do that ...

mod_rewrite regexp

I'm working on some rewrite rules, and for some reason a regexp I'm not expecting to pass (and does pass not on any of my regexp testers) is passing in mod_rewrite. The URL in question is: http://url.com/api/projects.json?division=aa And the rewrite rule is: RewriteEngine On RewriteBase / RewriteRule ^api\/([^.?#/%\s]+)\.([^#?\s]+)$...

Why doesn't finite repetition in lookbehind work in some flavors?p

I want to parse the 2 digits in the middle from a date in dd/mm/yy format but also allowing single digits for day and month. This is what I came up with: (?<=^[\d]{1,2}\/)[\d]{1,2} I want a 1 or 2 digit number [\d]{1,2} with a 1 or 2 digit number and slash ^[\d]{1,2}\/ before it. This doesn't work on many combinations i have tested ...

Need to reverse this regex pattern, but no clue how...

I found a regex pattern for PHP that does the exact OPPOSITE of what I'm needing, and I'm wondering how I can reverse it? Let's say I have the following text: Item_154 ($12) This pattern /\((.*?)\)/ gets what's inside the parenthesis, but I need to get "Item_154" and cut out what's in parenthesis and the space before the parenthesis. ...

Python regex confused by brackets ([])?

Is python confused, or is the programmer? I've got a lot of lines of this: some_dict[0x2a] = blah some_dict[0xab] = blah, blah What I'd like to do is to convert the hex codes into all uppercase to look like this: some_dict[0x2A] = blah some_dict[0xAB] = blah, blah So I decided to call in the regular expressions. Normally, I'd jus...