Regex: How to strip email before "@" symbol?
Hi all, I have the following String First Last <[email protected]> I would like to extract "first.last" from the email string using regex & PHP. How to go about this? Thanks in advance! ...
Hi all, I have the following String First Last <[email protected]> I would like to extract "first.last" from the email string using regex & PHP. How to go about this? Thanks in advance! ...
i m just wondering if we can do this with preg replace like if there's time like 1h 38 min can change to 98 mins 2h 20 min can change to 140 mins or just suggest me any other random function to this is simpler way thanks ...
How can you determine if a string is all caps with a regular expression. It can include punctuation and numbers, just no lower case letters. ...
How do i remove .aspx extension like: http://www.foo.com/bar --> http://www.foo.com/bar.aspx http://www.foo.com/bar?q=boo --> http://www.foo.com/bar.aspx?q=boo ...
I want to redirect /forums/uploads/profile/photo-thumb-[RANDOMNUMBER].jpg to a static no photo file like: /forums/uploads/profile/photo-thumb-none.jpg I know it can be done with .htaccess I am currently experiencing lots of 404 Errors. Thanks ...
Hello dear friends ! Please help me solve this strange situation: Here is code: The link is so - www.blablabla.ru#3 The regex is so: var id = window.location.href.replace(/\D/, '' ); alert(id); The regular expression is correct - it must show only numbers ... but it's not showing numbers :-( Can you please advice me and provide ...
Hello, I've got a regular expression that looks something like this: a(|bc) this expression matches perfectly a String "a", but it doesnt match "abc". What does the expression in the parenthesis mean? Edit: Using C# with the following code: Match m = Regex.Match(TxtTest.Text, TxtRegex.Text); if (m.Success) RtfErgebnis.Text = m.Va...
I have WYSIWYG and I don't allow users to upload images, just links to images outside the site. So I want to find every image link/path and replace it with some default thumb, where user can click and that image will be shown in modal window. I'm using qTip, but that will be my part of the job :) So if there is: http://sstatic.net/so/...
You have a URL which accepts a first_name and last_name in Django: ('^(?P<first_name>[a-zA-Z]+)/(?P<last_name>[a-zA-Z]+)/$','some_method'), How would you include the OPTIONAL URL token of title, without creating any new lines. What I mean by this is, in an ideal scenario: #A regex constant OP_REGEX = r'THIS IS OPTIONAL<title>[a-z]' #...
I'm getting $row['message'] from my mysql db and I need to remove all whitespaces like \n \t and so on. $row['message'] = 'This is a Text \n and so on \t Text text.'; should be formated to: $row['message'] = 'This is a Text and so on Text text.'; I tried $ro = preg_replace('/\s\s+/', ' ',$row['message']); echo $ro; but ...
Hi, I want to take the first comma seperated value from that string. "Lines.No;StartPos=3;RightAligned;MaxLength =2" I used "\b.*\;" regex to take "Lines.No". But the result is "Lines.No;StartPos=3;RightAligned;" thanks. ...
Hi, I've got a string like this: <block trace="true" name="AssignResources: Append Resources"> I need to get the word (or the characters to next whitespace) after < (in this case block) and the words before = (here trace and name). I tried several regex patterns, but all my attempts return the word with the "delimiters" ch...
As far as I know, Google Code Search and Google Analytics can support searching by regular expression, and both of them offer API that allows developer to call the service by HTTP. Besides these two, any more API can do so? ...
I'm not sure if there is a simple way of doing this, but is there a way to find multiple instances in an unknown string? For example: hellohellohellobyebyebyehello Without knowing the value of the above string, can I return something that will tell me that there are 3 instances of "hello" and 3 instances of "bye" (I'm not worried abo...
I'm trying to write a word counter for LyX files. Life is almost very simple as most lines that need to be ignored begin with a \ (I'm prepared to make the assumption that no textual lines begin with backslashes) - however there are some lines that look like real text that aren't, but they are enclosed by \begin_inset and \end_inset: I...
the url: http://site/page?object_id=2 I want the number (id). ...
i hat one task, and know i have to continue but have a bad experience with regexp ... :( can somebody help me : i need to take a sting from "domain url" with jquery : This is the address name : http://mydomain/Our-Company/default.aspx?txt=James D. Perrlo I want to take with jquery la string after "?txt=" in this case "James D. Pe...
Google currently uses keywords such as site: or is: in searches (the second example is from Gmail). I'm trying to develop a similar system and am wondering how best to go about identifying and handling those terms. For simplicity's sake, assume an OO language is being used (Ruby, Python, Java, C#, et al). Currently, my plan is to have a...
Hello, i uwant to cach input, which seems to be like SQL injection. So I wrote the method: public static bool IsInjection(string inputText) { bool isInj = false; string regexForTypicalInj = @"/\w*((\%27)|(\'))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/ix"; Regex reT = new Regex(regexForTypicalInj); ...
I need to replace a word in a string looking like "duh duh something else duh". I only need to replace the second "duh", but the first and the last ones need to stay untouched, so replace() and replaceFirst() don't work. Is there a method like replaceFirst(String regex, String replacement, int offset) that would replace the first occurre...