473,225 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Regular expression problem - Replacing a pattern

Hello,

I have a text file that I load up to a string. The text includes
certain expression like {firstName} or {userName} that I want to match
and then replace with a new expression. However, I want to use the
text included within the brackets to do a lookup so that I can replace
the expression with the new text.

For example:

Lets say the text file reads:
Hello {firstName}, Your account {accountName} has been updated.

I need to figure out how to write the expression so that the string
reads like:
Hello Dimitris, Your account Hotmail has been updated.

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.

Any help would be appreciated.

Dimitris
Nov 16 '05 #1
11 5318
for simple replacement like this you can use "String.Relace()" function
without having to use Regex.

String template = "Hello {firstName}, Your account {accountName} has been
updated.";
String name = "Dimitris";
String account = "Hotmail";
String message = "";

message = template.Replace("{firstName}", name);
message = message.Replace("{accountName}", account);

Console.WriteLine("String Replate: " + message);

// Alternative: regex
// since { and } are control chars u have to escape using \
message = Regex.Replace(template, @"\{firstName\}", name);
message = Regex.Replace(message, @"\{accountName\}", account);

Console.WriteLine("Regex Replate: " + message);

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.
i'm not sure what mean here, can you explain it a little more

anyway hope that helps,

Du

"Dimitris Georgakopuolos" <di*******@hotmail.com> wrote in message
news:ea**************************@posting.google.c om... Hello,

I have a text file that I load up to a string. The text includes
certain expression like {firstName} or {userName} that I want to match
and then replace with a new expression. However, I want to use the
text included within the brackets to do a lookup so that I can replace
the expression with the new text.

For example:

Lets say the text file reads:
Hello {firstName}, Your account {accountName} has been updated.

I need to figure out how to write the expression so that the string
reads like:
Hello Dimitris, Your account Hotmail has been updated.

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.

Any help would be appreciated.

Dimitris

Nov 16 '05 #2
If you need to do a look-up somewhere, you can always use a MatchEvaluator.
Whatever is matched in this case will be sent to a function where you can return
the replacement result. If the match is firstName, then you can replace that
with
some user's first name. If the match is accountName, do your look-ups and
make the replacement for that.

It sounds like you want a generic tag replacement method and the MatchEvaluator
is exactly what you'd want in that case. Check out www.regexlib.com. A friend
of mine runs the site and they have loads of regular expressions stuff going on.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Du Dang" <vi*******@hotmail.com> wrote in message
news:Ix********************@nnrp1.uunet.ca...
for simple replacement like this you can use "String.Relace()" function
without having to use Regex.

String template = "Hello {firstName}, Your account {accountName} has been
updated.";
String name = "Dimitris";
String account = "Hotmail";
String message = "";

message = template.Replace("{firstName}", name);
message = message.Replace("{accountName}", account);

Console.WriteLine("String Replate: " + message);

// Alternative: regex
// since { and } are control chars u have to escape using \
message = Regex.Replace(template, @"\{firstName\}", name);
message = Regex.Replace(message, @"\{accountName\}", account);

Console.WriteLine("Regex Replate: " + message);

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.


i'm not sure what mean here, can you explain it a little more

anyway hope that helps,

Du

"Dimitris Georgakopuolos" <di*******@hotmail.com> wrote in message
news:ea**************************@posting.google.c om...
Hello,

I have a text file that I load up to a string. The text includes
certain expression like {firstName} or {userName} that I want to match
and then replace with a new expression. However, I want to use the
text included within the brackets to do a lookup so that I can replace
the expression with the new text.

For example:

Lets say the text file reads:
Hello {firstName}, Your account {accountName} has been updated.

I need to figure out how to write the expression so that the string
reads like:
Hello Dimitris, Your account Hotmail has been updated.

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.

Any help would be appreciated.

Dimitris


Nov 16 '05 #3
Du,

I appreciate your help. I apologize for not being clear the first
time around. What I am trying to do is retrieve the values to do the
replacement dynamically, therefore I do not know ahead of time in
design time of the type of fields to look for; it could be
{firstName} or {lastName} or 100 other fields that I don't want to
hard code.

I was looking at an example like this for dates and want to do
something similar for my scenario but I am not sure of the best way to
accomplish it:

return Regex.Replace(input,
"\\b(?<month>\\d{1,2})/(?<day>\\d{1,2})/(?<year>\\d{2,4})\\b",
"${day}-${month}-${year}");

Would something like this work:

return Regex.Replace(input,
"{(?<name>}",
GetReplacement("${name});

Thanks for all your help,

Dimitris

"Du Dang" <vi*******@hotmail.com> wrote in message news:<Ix********************@nnrp1.uunet.ca>...
for simple replacement like this you can use "String.Relace()" function
without having to use Regex.

String template = "Hello {firstName}, Your account {accountName} has been
updated.";
String name = "Dimitris";
String account = "Hotmail";
String message = "";

message = template.Replace("{firstName}", name);
message = message.Replace("{accountName}", account);

Console.WriteLine("String Replate: " + message);

// Alternative: regex
// since { and } are control chars u have to escape using \
message = Regex.Replace(template, @"\{firstName\}", name);
message = Regex.Replace(message, @"\{accountName\}", account);

Console.WriteLine("Regex Replate: " + message);

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.


i'm not sure what mean here, can you explain it a little more

anyway hope that helps,

Du

"Dimitris Georgakopuolos" <di*******@hotmail.com> wrote in message
news:ea**************************@posting.google.c om...
Hello,

I have a text file that I load up to a string. The text includes
certain expression like {firstName} or {userName} that I want to match
and then replace with a new expression. However, I want to use the
text included within the brackets to do a lookup so that I can replace
the expression with the new text.

For example:

Lets say the text file reads:
Hello {firstName}, Your account {accountName} has been updated.

I need to figure out how to write the expression so that the string
reads like:
Hello Dimitris, Your account Hotmail has been updated.

after the replacement. Keep in mind that I need to use the value
contained in the brackets so that I can do a lookup to figure what the
corresponding replacement is.

Any help would be appreciated.

Dimitris

Nov 16 '05 #4
Hi !

Dimitris Georgakopuolos wrote:
[...snip...]
What I am trying to do is retrieve the values to do the
replacement dynamically, therefore I do not know ahead of time in
design time of the type of fields to look for; it could be
{firstName} or {lastName} or 100 other fields that I don't want to
hard code. [...snip...] Would something like this work:

return Regex.Replace(input,
"{(?<name>}",
GetReplacement("${name});

[...snip...]

Let's assume your string is "Hello {firstName}, Your account {accountName}
has been
updated."

As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to start
with would be "\{.\}" which would detect wether there is any occurrence of a
pair of curly brackets in your string. Remember to put an @ in front of your
regular expression string, so C# knows the \ belong into your string and are
not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression above
would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the . "lazy"
by adding a "?" behind. That makes "\{.?\}" for our improved expression.
This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular expression, so
we crate a named group: "\{(?'groupname'.?)\}". This will find any sequence
of characters (.?) between a pair of curly brackets (\{ and \}) and store it
in the group named "groupname" for each match. ?'groupname' names the group
(you can use ?<groupname> instead) and everything else between the () makes
the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ==========================
=====

string myString = "Hello {firstName}, Your account {accountName} has been
updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.?)\}",
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically
// on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ==========================
=====
Nov 16 '05 #5
FYI, the code I posted previously has not been tested...
Nov 16 '05 #6
And add an additional ":
myString = Regex.Replace(myString, @"\{" + lookForMe + @"\}",

^
missing "-------------------------------------------------|
Nov 16 '05 #7

"Michael Voss" <mi**********@lvrREMOVE.deCAPS> schrieb im Newsbeitrag
news:4083d5cb$1@news...
Hi !

Dimitris Georgakopuolos wrote:
[...snip...]
What I am trying to do is retrieve the values to do the
replacement dynamically, therefore I do not know ahead of time in
design time of the type of fields to look for; it could be
{firstName} or {lastName} or 100 other fields that I don't want to
hard code. [...snip...]
Would something like this work:

return Regex.Replace(input,
"{(?<name>}",
GetReplacement("${name});

[...snip...]

Let's assume your string is "Hello {firstName}, Your account

{accountName} has been
updated."

As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to start with would be "\{.\}" which would detect wether there is any occurrence of a pair of curly brackets in your string. Remember to put an @ in front of your regular expression string, so C# knows the \ belong into your string and are not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression above would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the . "lazy" by adding a "?" behind. That makes "\{.?\}" for our improved expression.
This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular expression, so we crate a named group: "\{(?'groupname'.?)\}". This will find any sequence of characters (.?) between a pair of curly brackets (\{ and \}) and store it in the group named "groupname" for each match. ?'groupname' names the group (you can use ?<groupname> instead) and everything else between the () makes the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ========================== =====

string myString = "Hello {firstName}, Your account {accountName} has been
updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.?)\}",
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically
// on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ========================== =====

Nov 16 '05 #8
Oops - I should rather test the code I give away before posting...
I missed a very important "*" for the Regex to match not just one character
between {}...
As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to start with would be "\{.*\}" which would detect wether there is any occurrence of a
^
--------------------| need a "*" here to match more than one character !!!!
pair of curly brackets in your string. Remember to put an @ in front of your regular expression string, so C# knows the \ belong into your string and are not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression above would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the .* "lazy"
^
----------------------------------------------------------------------|
need another "*" here to match more than one character !!!!
by adding a "?" behind. That makes "\{.*?\}" for our improved expression. ^
-----------------------------------------|
and another "*" goes here !!!!!!
This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular expression, so we crate a named group: "\{(?'groupname'.*?)\}". This will find any sequence
^
-------------------------------------------|
ok, another "*" here ... of characters (.*?) between a pair of curly brackets (\{ and \}) and store it
^
------------------|
and "*" here again !!!!
in the group named "groupname" for each match. ?'groupname' names the group (you can use ?<groupname> instead) and everything else between the () makes the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ==========================
string myString = "Hello {firstName}, Your account {accountName} has been
updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.*?)\}", ^
-------------------------------------------------|
and again another "*" here !!!!!! That's it !
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically
// on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ==========================

Sorry, but I had no time to test it before I posted originally...
Nov 16 '05 #9
lena test
"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote in message
news:40876e39$1@news...

"Michael Voss" <mi**********@lvrREMOVE.deCAPS> schrieb im Newsbeitrag
news:4083d5cb$1@news...
Hi !

Dimitris Georgakopuolos wrote:
[...snip...]
What I am trying to do is retrieve the values to do the
replacement dynamically, therefore I do not know ahead of time in
design time of the type of fields to look for; it could be
{firstName} or {lastName} or 100 other fields that I don't want to
hard code. [...snip...]
Would something like this work:

return Regex.Replace(input,
"{(?<name>}",
GetReplacement("${name});

[...snip...]

Let's assume your string is "Hello {firstName}, Your account

{accountName}
has been
updated."

As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to

start
with would be "\{.\}" which would detect wether there is any occurrence of a
pair of curly brackets in your string. Remember to put an @ in front of your
regular expression string, so C# knows the \ belong into your string and

are
not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression

above
would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the .

"lazy"
by adding a "?" behind. That makes "\{.?\}" for our improved expression.
This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular

expression, so
we crate a named group: "\{(?'groupname'.?)\}". This will find any sequence
of characters (.?) between a pair of curly brackets (\{ and \}) and

store it
in the group named "groupname" for each match. ?'groupname' names the

group
(you can use ?<groupname> instead) and everything else between the ()

makes
the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ========================== =====

string myString = "Hello {firstName}, Your account {accountName} has been updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.?)\}",
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically
// on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ==========================
=====


Nov 16 '05 #10
aaaaaaaaaaaaaaaaaa
"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote in message
news:40876fea$1@news...
Oops - I should rather test the code I give away before posting...
I missed a very important "*" for the Regex to match not just one character between {}...
As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to start
with would be "\{.*\}" which would detect wether there is any occurrence

of a
^
--------------------| need a "*" here to match more than one character

!!!!
pair of curly brackets in your string. Remember to put an @ in front of your
regular expression string, so C# knows the \ belong into your string and

are
not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression

above
would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the .*

"lazy"
^
----------------------------------------------------------------------|
need another "*" here to match more than one character !!!!
by adding a "?" behind. That makes "\{.*?\}" for our improved expression. ^
-----------------------------------------|
and another "*" goes here !!!!!!
This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular
expression, so
we crate a named group: "\{(?'groupname'.*?)\}". This will find any sequence
^
-------------------------------------------|
ok, another "*" here ...
of characters (.*?) between a pair of curly brackets (\{ and \}) and

store it
^
------------------|
and "*" here again !!!!
in the group named "groupname" for each match. ?'groupname' names the group
(you can use ?<groupname> instead) and everything else between the ()

makes
the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ==========================
string myString = "Hello {firstName}, Your account {accountName} has been updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.*?)\}",

^
-------------------------------------------------|
and again another "*" here !!!!!! That's it !
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically
// on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ==========================
Sorry, but I had no time to test it before I posted originally...

Nov 16 '05 #11
privet
"Boris" <bo*****@optonline.net> wrote in message
news:y5***********************@news4.srv.hcvlny.cv .net...
lena test
"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote in message
news:40876e39$1@news...

"Michael Voss" <mi**********@lvrREMOVE.deCAPS> schrieb im Newsbeitrag
news:4083d5cb$1@news...
Hi !

Dimitris Georgakopuolos wrote:
[...snip...]
> What I am trying to do is retrieve the values to do the
> replacement dynamically, therefore I do not know ahead of time in
> design time of the type of fields to look for; it could be
> {firstName} or {lastName} or 100 other fields that I don't want to
> hard code.
[...snip...]
> Would something like this work:
>
> return Regex.Replace(input,
> "{(?<name>}",
> GetReplacement("${name});
[...snip...]

Let's assume your string is "Hello {firstName}, Your account {accountName}
has been
updated."

As Du pointed out, the { and } will have to be escaped. Then, you are
looking for everything between \{ and \}, so the regular expression to

start
with would be "\{.\}" which would detect wether there is any occurrence of
a
pair of curly brackets in your string. Remember to put an @ in front
of
your
regular expression string, so C# knows the \ belong into your string
and are
not C#-escape-characters.
You will most likely want to find the shortest pair, as the expression

above
would find one occurence in our string, containing "firstName}, Your
account {accountName" between the pair of brackets. So we make the .

"lazy"
by adding a "?" behind. That makes "\{.?\}" for our improved

expression. This expression will match twice, with "firstname" and "accountname"
included between the two pairs of brackets.
Next, you want to remember the value that matches the regular

expression,
so
we crate a named group: "\{(?'groupname'.?)\}". This will find any

sequence
of characters (.?) between a pair of curly brackets (\{ and \}) and

store
it
in the group named "groupname" for each match. ?'groupname' names the

group
(you can use ?<groupname> instead) and everything else between the ()

makes
the expression, that will be stored in the group "groupname".
Finally, we want to iterate over the matches:

================================================== ==========================
=====

string myString = "Hello {firstName}, Your account {accountName} has been updated.";

// Create a new regular expression
// Adding the Singleline-Option makes the . include \n-Characters.
// If there is no \n between {}, make it RegexOptions.None or
// do not add any option
Regex expression = new Regex(@"\{(?'groupname'.?)\}",
RegexOptions.Singleline);

// Find all matches for our regular expression in myString
MatchCollection matchCol = expression.Matches(myString);

// Iterate over the matches
foreach (Match foundOne in matchCol)
{
// Get the contents between the {} for the current match
// Will be "firstName" for the first match and "accountName"
// for the second match
string lookForMe = foundOne.Groups["groupname"].Value;

// Find the Value to replace lookForMe with
string replacement = this.findSomeDataForKeyString(lookForMe);

// Finally, replace lookForMe by replacement in the source string
// We do this by a new regular expression which is built dynamically // on the key we are processing...
myString = Regex.Replace(myString, @"\{" + lookForMe + @\}",
replacement);
};

================================================== ==========================
=====



Nov 16 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Tina Li | last post by:
Hello, I've been struggling with a regular expression for parsing XML files, which keeps giving the run time error "maximum recursion limit exceeded". Here is the pattern string: ...
1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
1
by: William Morris | last post by:
Been pounding on this for an hour and eating up my day's productivity, so I thought I'd throw a question out there. (I'm also reading through the Google archives to try to find this answer...) ...
5
by: Mahesha | last post by:
Hello, I need help in replacing one string pattern with another. Ex: I have a financial security expression like log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002) Here "T 3.25 6/24/2004" is a...
3
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is...
8
by: P K | last post by:
I have an XML in which I have to comment out the <responseopt> tag the tags between this tag should not be commented I plan to use regular expressions The tags looks like this <responseopt...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
17
by: Randy Webb | last post by:
I know that the /g flag will match all occurrences. Is there a way, with a Regular Expression, to match all occurrences *except* the last one? pattern = /df/g; var myString = "asdfasdfasdfasdf";...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.