I think you can guess the problem I'm having. I'm inserting filenames in to an sql database in C++ Builder. Some files have an apostrophe in their name. This breaks the sql insert query. the usual way to fix this is to double up and apostrophes you want to be part of the field value.
For example if I want to add 'george's' to field ...
Hi, I want to perform a simple (ideally RegEx) search and replace over a large number of PDF documents in a WinForms application.
I've got as far as using ITextSharp to read and tokenise existing documents, from which I can search for the text. The problem is that it doesn't seem to support generating new document from these tokens (onl...
Hello,
If have a following element in my XSL file:
<xsl:value-of select="replace(lower-case(@name), '_([a-z0-9])', '$1')" />
For example from 'get_polygene_lubricants' it makes 'getpolygenelubricants'.
What I want to do is to replace the first letter after '_' with
the uppercase variant of the letter. I googled, read documentation,
...
I have this java string:
String bla = "<my:string>invalid_content</my:string>";
How can I replace the "invalid_content" piece?
I know I should use something like this:
bla.replaceAll(regex,"new_content");
in order to have:
"<my:string>new_content</my:string>";
but I can't discover how to create the correct regex
help please :)...
I would like do do the following in Javascript (pseudo code):
myString.replace(/mypattern/g, f(currentMatch));
that is, replace string isn't fixed, but function of current match.
...
I want to remove square brackets from an SQL string, but only where there is no whitespace inside them.
E.g. "SELECT [intId], [The Description]" should return "SELECT intId, [The Description]".
I can get the square brackets without spaces inside with the regular expression:
\[[^\s]*\]
How can the square brackets from these matches b...
hello
how can I replace 2 strings in the same time? for example let's say I have string like this:
str1 = "AAAA BBBB CCCC DDDD"
i want to replace every "AAAA" with "CCCC" and every "CCCC" with "AAAA" but if i did:
str1.gsub("AAAA","CCCC") # CCCC BBBB CCCC DDDD
str1.gsub("CCCC","AAAA") # AAAA BBBB AAAA DDDD
what I want str1 to be "C...
Hey dudes,
what's the best way to do this? i'm no command line warrior, but i was thinking there's possibly a way using grep and cat.
i just want to replace a string that occurs in a folder and sub-folders. what's the best way to do this? i'm running ubuntu if that matters.
-d
...
The following code works, but I'm sure there is a more compact way to achieve the same result, particularly the string replacement:
$('#nav-main .nav-sub').each(function() {
var name = $(this).attr('id');
$(this).children('li').children('a').each(function() {
var text = $(this).text().toLowerCase();
var spaces = / /g;
var sub...
Is there an inbuilt PHP function to replace multiple values inside a string with an array that dictates exactly what is replaced with what?
For example:
$searchreplace_array = Array('blah' => 'bleh', 'blarh' => 'blerh');
$string = 'blah blarh bleh bleh blarh';
And the resulting would be: 'bleh blerh bleh bleh blerh'.
...
I'm trying to build a simple "User Template" system so that my users can edit the layout of RSS feed items and system-generated emails without messing with view files and such. This is the function I'm using to replace the tags in a string with content:
private const string URL_TAG_REGEX = @"{{(?<TagName>\w*)}}";
private static string R...
If I have a file containing some escaped parens, how can I replace all instances with an unescaped paren using Perl?
i.e. turn this:
.... foo\(bar ....
into this
.... foo(bar ....
I tried the following but receivied this error message:
perl -pe "s/\\\(/\(/g" ./file
Unmatched ( in regex; marked by <-- HERE in m/\\( <-- HERE / at ...
We're using DevExpress control toolkit for our ASP.NET application. I would like to replace the DevExpress default dropdown calendar with my own because of the following reasons:
DevExpress dropdown calendar gets positioned absolutely next to the textbox it is assigned to. This is bad, because on IE it gets obscured by other relatively...
I tried the code unsuccessfully
:%s/\n/*\n/g
...
My previous question seems to be a bit ambiguous, I will rephrase it:
I have a file like this:
copythis abc
replacethis1 xyz
qwerty replacethis2
hasfshd replacethis3 fslfs
And so on...
NOTE: replacethis1, replacethis2, replacethis3, ... could be any words
How do I replace "replacethis1","replacethis2","replacethis3",.. word by "copy...
I've scripted up a simple ksh that calls a Perl program to find and replace in files.
The passed-in arg is the home directory:
perl -pi -e 's/find/replace/g' $1/*.html
It works great. However, I'd like to output all the changes to a log file. I've tried piping and redirecting and haven't been able to get it work. Any ideas?
Thank...
I've been working on this RegEx for the past day or so and I think I have it worked out so that it returns the data I want. First a little background.
I have a content editor that users will be able to edit web pages. They can format text, add links, etc.. standard content editor stuff. When they click save, the editor provides the ab...
Hi, on a page there a several links of:
<a class="linked" href="http://link1.com>http://link1.com</a>
<a class="linked" href="http://link2.com>http://link2.com</a>
How would one remove the second http:// in each link so it can't be seen on the screen.
I've tried this to no avail:
$(document).ready(function() {
$(...
I tried the following code unsuccessfully
:%s/{car,beatles}/mas/g
How can I replace car and beatles with mas in Vim with a single command?
...
I have a project that includes 49 folders, each one has a file called index.php
All index.php files are almost the same except for one part that changes depending on the folder it is in.
<?php include_once("/home/bgarch/public_html/galleryheader.html"); ?>
<?php include_once("/home/bgarch/public_html/culture/loadscripts.html"); ?>
</h...