I've got a string like...
"labour 18909, liberals 12,365,conservatives 14,720"
...and i'd like a regex which can get rid of any thousands separators so i can pull out the numbers easily. Or even a regex which could give me a tidy array like:
(labour => 18909, liberals => 12365, conservatives => 14720)
Oh i wish i had the time to f...
Let's say I have this input:
I can haz a listz0rs!
# 42
# 126
I can haz another list plox?
# Hello, world!
# Welcome!
I want to split it so that each set of hash-started lines becomes a list:
I can haz a listz0rs!
<ul>
<li>42</li>
<li>126</li>
</ul>
I can haz another list plox?
<ul>
<li>Hello, world!</li>
<li>Welcome!...
I want to check whether there is string starting from number and then optional character with the help of the regex.So what should be the regex for matching the string which must be started with number and then character might be there or not.Like there is string "30a" or "30" it should be matched.But if there is "a" or some else charact...
I found this regex statement at http://en.wikipedia.org/wiki/Sentence_boundary_disambiguation for Sentence boundary disambiguation, but am not able to use it in a Ruby split statment. I'm not too good with regex so maybe I am missing something? This is statment:
((?<=[a-z0-9)][.?!])|(?<=[a-z0-9][.?!]\"))(\s|\r\n)(?=\"?[A-Z])
and thi...
Please consider the following code with which I'm trying to parse only the first phpDoc style comment (noy using any other libraries) in a file (file contents put in $data variable for testing purposes):
$data = "
/**
* @file A lot of info about this file
* Could even continue on the next line
* @author [email protected]
*...
I have this:
/**
* @file
* API for loading and interacting with modules.
* More explaination here.
*
* @author Reveller <me@localhost>
* @version 19:05 28-12-2008
*/
I'm looking for a regex to strip all but the @token data, so the result would be:
@file API for loading and interacting with modules. More explaination here.
@au...
Hi
Iam looking for a php parser that can do this.
{tag} Replace the tag with text comming from a function
{tag(params)} It must support params
{tag({tag(params)},{tag(params)})} It must support nesting
{tag()?
else
} It must support Tests
{$tag=value} It must support varriables
Do anyone of you know of an parser that can do thi...
Hi Guys,
Does anybody have an example of spliting a html string (coming from a tiny mce editor) and splitting it into N parts using C#?
I need to split the string evenly without splitting words.
I was thinking of just splitting the html and using the HtmlAgilityPack to try and fix the broken tags. Though I'm not sure how to find the s...
What's the regular expression to check if a string starts with "mailto" or "ftp" or "joe" or...
Now I am using C# and code like this in a big if with many ors:
String.StartsWith("mailto:")
String.StartsWith("ftp")
It looks like a regex would be better for this. Or is there a C# way I am missing here?
...
Hi All,
I've got a regular expression in my cocoa-touch app (using RegexKitLite).
NSString *week = [[NSString alloc] initWithFormat:@"%@", [pageContent stringByReplacingOccurrencesOfRegex:@"<select name=\"week\" class=\"selectbox\" style='width:134' onChange=\"doDisplayTimetable(NavBar, topDir);\">(.+?)<option value=\"(.+?)\">(.+?)...
Hi,
I'm writing a bash script that will show me what TV programs to watch today, it will get this information from a text file.
The text is in the following format:
Monday:
Family Guy (2nd May)
Tuesday:
House
The Big Bang Theory (3rd May)
Wednesday:
The Bill
NCIS
NCIS LA (27th April)
Thursday:
South Park
Friday:
FlashForward
Saturday:...
When validating an email address with the regex validation component, an additional RequiredFieldValidator must be added to ensure there is a value present.
I've mostly taken care of this with a CustomFieldValidator, and taking care of this with Javascript.
Is there a better way of doing this?
...
In Notepad++ TextFX, is there a feature that can escape all reserved characters in a given string? Thanks.
...
I have got a file with following format.
1234, 'US', 'IN',......
324, 'US', 'IN',......
...
...
53434, 'UK', 'XX', ....
...
...
253, 'IN', 'UP',....
253, 'IN', 'MH',....
Here I want to extract only those lines having 'IN' as 2nd keyword. i.e.
253, 'IN', 'UP',....
253, 'IN', 'MH',....
Can any one please tell me a command to grep it...
Working in ASP.NET (VB), I am trying to develop a simple search results page for my website.
The process is as follows:
(1) The site's user enters a search phrase;
(2) The search results page searches the site's database, returns the page title as a link, and a short snippet from each search "hit", with the search phrase highlighted...
Hi,
I've got a challenge that I am hoping that the SO community is able to help me with.
I trying to parse a lot of html documents in my PHP application to remove personal details, such as names, addresses and phone numbers. I can remove most of these details without too much trouble, however the phone number is a real problem for me....
[Required(ErrorMessage = "Date is required")]
[RegularExpression(@"^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26...
Hi all guys!
still on regex! i want learn it but i'm still crashing the head into my keybord! ;-)
ok very trivial for you, i'm sure!
Assuming i have this sting, the \s is where the space actualy is... \n where linebreak is..
EDITED:
OTHERFIELD: Other text here...`\n`
DESCRIPTION: The quick brown fox jum`\s\n`
`\s`ps over th...
I need to parse text files where relevant information is often spread across multiple lines in a nonlinear way. An example:
1234
1 IN THE SUPERIOR COURT OF THE STATE OF SOME STATE
2 IN AND FOR THE COUNTY OF SOME COUNTY
3 UNLIMITED JURISDICTION ...
Hi, I am trying to write a regexp that removes file paths from links and images.
href="path/path/file" to href="file"
href="/file" to href="file"
src="/path/file" to src="file"
and so on...
I thought that I had it working, but it messes up if there are two paths in the string it is working on. I think my expression is too greedy. It ...