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 the following regex, where I want to match any explicit dot followed by one or more:
<b> <i> <u> </b> </i> </u>
I would like this Regex to NOT match this pattern if it occurs at the end of the string.
string = Regex.Replace(string, "\.((<[\/biu]+>)+)", ".$1||")
Ex:
This <b>should match.</b> allright.
This <i><b>shouldn't m...
I suspect this has already been answered somewhere, but I can't find it, so...
I need to extract a string from between two tokens in a larger string, in which the second token will probably appear again meaning... (pseudo code...)
myString = "A=abc;B=def_3%^123+-;C=123;" ;
myB = getInnerString(myString, "B=", ";" ) ;
method getInne...
I have fighting to get a IN parameter to work inside of a LIKE statement now for hours!
I am using a CachedRowSet, which I understand should follow the same rules as a PreparedStatement.
Here is the basic query:
CachedRowSet cache;
String sql = "SELECT x " +
"FROM Y " +
"WHERE z LIKE '?__'"
cache.setComm...
Any time I want to replace a piece of text that is part of a larger piece of text, I always have to do something like:
"(?P<start>some_pattern)(?P<replace>foo)(?P<end>end)"
And then concatenate the start group with the new data for replace and then the end group.
Is there a better method for this?
...
I want to reduce the number of patterns I have to write by using a regex that picks up any or all of the pattern when it appears in a string.
Is this possible with Regex?
E.g. Pattern is: "the cat sat on the mat"
I would like pattern to match on following strings:
"the"
"the cat"
"the cat sat"
...
"the cat sat on the mat"
But it sho...
I need to extract tokens that are marked with curly brackets from a given string.
I have tried using Expresso to construct something that will parse...
-------------------------------------------------------------
"{Token1}asdasasd{Token2}asd asdacscadase dfb db {Token3}"
-------------------------------------------------------------
...
I want to reverse a regular expression. i.e. given a regular expression, I want to produce any string that will match that regex.
I know how to do this from a theoretical computer science background using finite state machine, I just want to know if someone has already written a library to do this. :)
I'm using Python, so I'd like a py...
I have the following text:
<i><b>It is noticeably faster.</b></i> <i><b>They take less disk space.</i>
And the following regex:
(</[b|i|u]>)+(\s*)(<[b|i|u]>)+
The matching creates the following groups:
0: </b></i> <b><i>
1: </i>
2: spaces
3: <b>
How can I change my regex so it creates groups like that:
0: </b></i> <b><i>
1:...
Anyone have a regex to strip lat/long from a string? such as:
ID: 39.825 -86.88333
...
The UltraEdit text editor includes a Perl and Unix compatible regex engine for searching.
I want to be able to match a string line this:
<branch id="attribute">
<leaf id="attribute"/>
<leaf id="attribute"/>
<leaf id="attribute"/>
</branch>
With something like this:
/<branch id="attribute">.*</branch>/gis
Does any one know of...
I'd like to create a String.replaceAll() method in JavaScript and I'm thinking that using a RegEx would be most terse way to do it. However, I can't figure out how to pass a variable in to a RegEx. I can do this already which will replace all the instances of "B" with "A".
"ABABAB".replace(/B/g, "A");
But I want to do something like...
Suppose you have a list of acronym's that define a value (ex. AB1,DE2,CC3) and you need to check a string value (ex. "Happy:DE2|234") to see if an acronym is found in the string. For a short list of acronym's I would usually create a simple RegEx that used a separator (ex. (AB1|DE2|CC3) ) and just look for a match.
But how would I ta...
Im newbie in Python, i learning regex, but need help here
Heres comes the source
<a href="http://www.ptop.se" target="_blank">http://www.ptop.se</a>
I trying to code a tool that only prints out http://ptop.se, Can you help me please?
...
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 to split the example string --
~Peter~Lois~Chris~Meg~Stewie
on the character '~' and have the result be
Peter
Lois
Chris
Meg
Stewie
Using a standard string split function in javascript or C# the first result is of course an empty string. I'd like to avoid having to ignore the first result because the first result may act...
I have had the need to use regular expressions only a few times in the work that I have done; however, in those few times I discovered a very powerful form of expression that would enable me to do some extremely useful things.
The problem is that the language used for regular expressions is wrong - full stop.
It is wrong from a psychol...
In Python, I can compile a regular expression to be case-insensitive using re.compile:
>>> s = 'TeSt'
>>> casesensitive = re.compile('test')
>>> ignorecase = re.compile('test', re.IGNORECASE)
>>>
>>> print casesensitive.match(s)
None
>>> print ignorecase.match(s)
<_sre.SRE_Match object at 0x02F0B608>
Is there a way to do the same, bu...
I have to replace the content of this xml string through java
<My:tag>value_1 22
value_2 54
value_3 11</My:tag>
so, this string has been taken from an xml and when I acquire it I have this result:
<My:tag>value_1 22
value_2 54
value_3 11</My:tag>
If I try to replace the content by this way:
String regex = "(<My:tag>)(.*)(...
I am working on a simple token replacement feature of our product. I have almost resolved all the issue but I missed one thing. A token must support attributes, and an attribute can also be a token. This is part of a bigger project. hope you can help.
The begining tag is "**#[**" and the ending tag is "**]**". Say, #[FirstName], #[LastN...