I saved a value by shell command:
For example:
timeoutvalue=`echo "timeout=2.0"`
And I have to grep the value of timeout from another text, and replace it with this timeoutvalue.
For example, the text is egtest:
<host ip="255.255.255.0" name="testhost" description="hostfortest" connection="xmlrpc" timeout=4.0/>
I want to grep the v...
/(?![a-z]+:)/
Anyone knows?
...
I've got a string split, using a regular expression.
Regex.Split(str, @"\s");
What does this convert to without regex? reason being I'm porting this to PHP and an SQL function. Unless you can show me the PHP code for the same...
...
Hi,
I am trying to replace only " with " within EntryBody
I tried <mt:entrybody replace=""","""> but this seems to not work. Version is MT5.02 and I don't want to use <mt:entrybody encode_html="1">
What I am trying to do is import all entires using CSV(comma separated) format(clients request) and " (quotation mark) inside E...
HTML:
<dt>
<a href="#profile-experience" >Past</a>
</dt>
<dd>
<ul class="past">
<li>
President, CEO & Founder <span class="at">at</span> China Connection
</li>
<li>
Professional Speaker and Trainer <span class="at">at</span> Edgemont Enterprises
</li>
<li>
...
I have to extract a parameter from a configuration file, and replace its values with another given value.
The config file is:
<host ip="200.200.200.200" name="testhost" description="test server" type="TEST_Duplex " connection="xmlrpc" xmldefaulttimeout="2.0" xmlspecifictimeout ="8.0"/>
I have to replace the value of xmldefaulttimeout=...
$contents = 'url("/test/what)';
echo preg_replace('/url\(([\'"]?)(?!(?:[a-z]+:)|\/|[\'"]\/)/i', 'url(\1'. '/prefix' . '\2', $contents);
I want to append /prefix to those urls that didn't use absolute path(start with /), the above works, but is pretty ugly.
Is there a more elegant solution?
...
Hello,
I'm trying to remove nested quoting from my bulletin board, but I'm having some issues.
Example input:
[quote author=personX link=topic=12.msg1910#msg1910 date=1282745641]
[quote author=PersonY link=topic=12.msg1795#msg1795 date=1282727068]
The message in the original quote
[/quote]
A second message quoting the firs...
I have a sql table and I have a column which includes data such as: B757-34-11-00-I-1, A300-223100-0503-1 etc.
A300-223100-0503-1 -> 223100-0503-1
B757-34-11-00-I-1 -> 34-11-00-I-1
How can i do that with regex? I need two kinds of solutions: sql and C#. how can I do that with sql query in SQL and C#
i need drop charater as far...
Hi!
I'm trying to store regexes in a database but they're not working when used in a .sub(), even though the same regex works when used directly in .sub() as a string.
regex = Class.object.field // Class.object is an active record containing "\w*\s\/\s"
mystring = "first / second"
mystring.sub(/#{regex}/, '')
// => nil
mystring.sub(...
how can i have a regular expression that tests for spaces or tabs but not newlines. i tried \s but found out that it tests for newlines too.
i use C#/WPF but it shouldn't matter
...
Hello guys,
I'm trying to establish some way of mapping a String document to a HashMap as follows:
the String contains key/value pair
$key1=value1
$key2=value2 value21
value22
$key3=value3
what I want to end up with is:
key1, value1
key2, value2 value21\nvalue22
key3, value3
Is there a pattern I can use for this? It looks like an...
How to count the number of times each word appear in a String in Java using Regular Expression?
...
i need the following -
if i have a sentence
$str = "i like programming very much";
and i search for a word
$word = "r";
i expect it to return the sentence
"i like programing very much"
I wrote the following regex for it, but it sometimes doesn't work.
$str = preg_replace("/([^\s{".preg_quote($word)."}]*?)(".preg_quote($word)...
There's a properties language bundle file:
label.username=Username:
label.tooltip_html=Please enter your username.</center></html>
label.password=Password:
label.tooltip_html=Please enter your password.</center></html>
How to match all lines that have both "_html" and "</center></html>" in that order and replace them with the same lin...
Hi,
Kindly help me know the regex to select only span id for a given span markup. I'm trying to do it from inside c#. My input is like . And I want as an output only >> id="x8x8d9s8" <<
Currently I'm trying to achieve above as follows but no luck, unfortunately ...
string innerPattern = @"(id=)\""|"|(.)*\""|"|";
Please no...
i'm looking for a way, to match all except the some word.
please tell me how i must wrote it?
when i wrote
$str = "i am a programmer";
$word = "am";
preg_match_all("/[^($word)]/", $str, $matched);// it do the same, if i when i wrote
preg_match_all("/[^$word]/", $str, $matched);
i also tried preg_match_all("/[^{$word}]/", $str, $mat...
Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
Hello,
i m stuck in weird regex problem, i m parsing some html table in php
regex i m using : <td[^>]*>(h.*?)</td>
<td>other data</td> <td>other data</td><td>Data_needed</td> <td>--</td>
but its matching all other data too
now i want to match it t...
HI,
I have a NSString that cotains a lot of text. Inside the text is a iTunes URL. The URL is masked with BBCode. How can I extract the plain URL?
Sorry, but my regex skills are really bad.
The text:
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam ...
I'm trying to find an optimized regex to return the N words (if available) around another one to build a summary. The string is in UTF-8, so the definition of "words" is larger than just [a-z]. The string that serves as the reference word could be in the middle of a word or not directly surrounded by spaces.
I've already got the followi...