I would like like to create a java regular expression that selects everything from file: to the last forward slash (/) in the file path. This is so I can replace it with a different path.
<!DOCTYPE "file:C:/Documentum/XML%20Applications/joesdev/goodnews/book.dtd"/>
<myBook>cool book</myBook>
Does anyone have any ideas? Thanks!!
...
I want to automatically process a WSDL file to discover defined Service / Port elements. Is this possible, using Java or some sort of Ant utility? If so, how?
...
Hi,
Based on a previous stack overflow question and contribution by cgoldberg, I came up with this regex using the python re module:
import re
urls = re.finditer('http://(.*?).mp3', htmlcode)
The variable urls is an iterable object and I can use a loop to access each mp3 file url individually if there is more than one :
for url in u...
I am looking to rewrite urls with multiple substrings. One substring is being requested as a subdirectory, while any others are requested as normal query string parameters.
For example, I would like to rewrite urls from
http://www.mysite.com/mark/friends?page=2
to
http://www.mysite.com/friends.php?user=mark&page=2
I am able t...
I've been investigating this issue that only seems to get worse the more I dig deeper.
I started innocently enough trying to use this expression to split a string on HTML 'br' tags:
T = captions.innerHTML.split(/<br.*?>/g);
This works in every browser (FF, Safari, Chrome), except IE7 and IE8 with example input text like this:
is inv...
This one is a real head scratcher for me...
var matches = Regex.Matches("<p>test something<script language=\"javascript\">alert('hello');</script> and here's <b>bold</b> and <i>italic</i> and <a href=\"http://popw.com/\">link</a>.</p>", "</?(?!p|a|b|i)\b[^>]*>");
The Regex is supposed to capture any HTML tag (open or cl...
As usual, regular expressions are causing my head to hurt.
I have the following strings (as examples) which I would like to parse:
Client: {Path=ClientName}, Balance: {Path=Balance, StringFormat='{0:0.00}'}
Client: {Path=ClientName}, Balance: {Path=Balance, StringFormat='Your balance is {0:0.00}.'}
I am looking for a regular expressi...
I have records in my database that are searched with user input, and initially, this was sufficient for finding the correct records.
"SELECT id FROM plants WHERE Flower LIKE '%" . $sanitizedUserInput . "%'"
This was working all well and good, but then things started to happen like, searching 'red' was getting plants with the character...
I need to replace the following:
CREATE TABLE /*!32312 IF NOT EXISTS*/ `access`
to
CREATE TABLE IF NOT EXISTS `access`
I've tried
:%s/\/\*\!\d+(.*)\*\//\1/g
But that didn't seem to go. What am I doing wrong?
...
Let's say I have an object that contains a Word property and a Sentence property. The sentence must use the word, and I want to replace the word in that sentence with a link using a public function (say, GetLinkedSentence). The catch is maybe the sentence uses a plural form of the word and maybe the "word" itself is actually a phrase, or...
I have text file with a row like this:
SendersTimeSeriesIdentification: COMPANY_A/COMPANY_B/REF_7/20090505
I'd like to replace all non-word chars in the value part with the character n, like this:
SendersTimeSeriesIdentification: COMPANYnAnCOMPANYnBnREFn7n20090505
But there are similar strings all over the file, which must remain i...
I'd like to HTML escape a specific phrase automatically and logically that is currently a statement with words highlighted with quotation marks. Within the statement, quotation or inch marks could also be used to describe a distance.
The phrase could be:
Paul said "It missed us by about a foot". In fact it was only about 9".
T...
Hi,
I'm having the following problem and wondered whether anyone could see why this is crashing my .net worker process (aspnet_wp.exe):
Dim pattern As String = "\{\{IF\(((?!\)}})(.))+,,,((\s)*(?!\)}})(.))+\)}}"
Dim mc As RegularExpressions.MatchCollection = Regex.Matches(txtContent.Text, pattern)
Works absolutely fine if a match ...
I would like to use a regular expression to match all words with more that one character, as opposed to words entirely made of the same char.
This should not match: ttttt, rrrrr, ggggggggggggg
This should match: rttttttt, word, wwwwwwwwwu
...
I have an xml document like the following:
<menuitem navigateurl="/PressCentre/" text="прес център">
<menuitem navigateurl="/PressCentre/RegisterForPressAlerts/" text="регистър за прес &#...
edit:
I need advice on best way to search with regex in vim and extract any matches that are discovered.
end edit.
I have a csv file that looks something like this:
two fields:
id
and
description
0g98932,"long description sometimes containing numbers like
1234567, or 0000012345 and even BR00012345 but always containing text"
I ...
I feel like an idiot for asking this but what would a regular expression be to match the literal string: {0}
This would be used in JavaScript with the string object's replace function. I've tried several things and nothing seems to work.
Thanks,
Frank
...
I'm building a Google App Engine app, and I have a class to represent an RSS Feed.
I have a method called setUrl which is part of the feed class. It accepts a url as an input.
I'm trying to use the re python module to validate off of the RFC 3986 Reg-ex (http://www.ietf.org/rfc/rfc3986.txt)
Below is a snipped which should work, right?...
Hi,
I have a folder pulled from a wordpress installation, >1000 files. Some php code is throwing an error due to trailing spaces on the very last line (I cleaned up an iframe injection on some final lines of pages, and did find/replace with a space, but didn't know that that would throw off all my code).
What's the most efficient way t...
Hi,
I am trying to use the cscope-indexer script. But I want to know how to change the following to include *.mm and *.java files?
egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
sort > $LIST_FILE
I tried
egrep -i '\.([chly](xx|pp)*|cc|hh|mm|java)$'
it does not work.
...