Hey,
Having a small problem for a quick "Search and Highlight" script that I'm working on. I'm using regular expressions because I'd like to do the searching all on client side, after the document has loaded. My search/highlight function goes like this:
function highlight(word, colour, container) {
var regex = new RegExp("(>[^<]*?)...
I've been using the excellent Tabular plugin in Vim to align things, but there's an alignment I want to do pretty commonly that I can't figure out the right regex for.
I want this
gem 'fakeweb'
gem 'factory_girl', '~> 1.3'
gem 'factory_girl_rails', '>= 1.0'
gem 'rspec', '>= 2.0'
gem 'rspec-rails', '>= 2.0'
to turn into this
gem 'fa...
I need to change below data
A320-ZL-522-01-1(2)
A320-ZL-531-01-1(1)
A320-ZL-531-01-1(2)
A320-ZL-531-01-1(1)
A320-ZL-531-01-1(2)
to
ZL-522-01-1
ZL-531-01-1
ZL-531-01-1
ZL-531-01-1
ZL-531-01-1
Can I do it with LINQ using RegEx?
public class MatchCTallyToCross
{
public List<string> Get(string CustomerNumber)
{
IEngMan...
I'm trying to match out of this text:
<a href="http://english317.ning.com/profiles/blogs/bad-business-writing-487">Continue</a>
</div>
<p class="small">
Added by <a href="/profile/KemberleyRamirez">Kemberley Ramirez</a> on...
Hi All;
I have a problem! I wanna detect any numbers in HTML content without numbers in tag attributes, I wanna change this numbers to other character then only numbers not in HTML TAG ATTRIBUTES that match with this REGEX.
Example:
Hi 3456; <a href="?id=4456">your code: 345</a>
Matched
3456, 345
Not Matched
4456
Thanks fr...
I think its more a charachters, anyway, I have a text file, consisted of something like that:
COMPANY NAME
City
Addresss,
Address number
Email
phone number
and so on... (it repeats itself, but with different data...), lets assume thing text is now in $strting variable.
I want to have an array (@row), for exa...
Hello,
I have the following code:
$string = '[url]http://google.com[/url]';
$bbreplace = array ('/\[url\](.+?)\[\/url\]/');
$bbreplacements = array ('<a href=\"\\1\">\\1</a>');
$string = preg_replace($bbreplace, $bbreplacements, $string);
print $string;
Which creates a url called http://google.com/ that points to
mydomain.com/"http:...
I need to check that a file contains some amounts that match a specific format:
between 1 and 15 characters (numbers or ",")
may contains at most one "," separator for decimals
must at least have one number before the separator
this amount is supposed to be in the middle of a string, bounded by alphabetical characters (but we have to e...
I need to extract something from a long piece of text across lots of db rows, in a Microsoft SQL Server database.
I could write a script to loop through and extract it, but I was hoping there was nice simple way I can do some SQL like:
SELECT IpAddress = matchFirst('RegEx',ColName)
FROM table
WHERE conditions
I've looked about but a...
var string = $.trim("How are you ? are you fine ?");
var part = $.trim("How are you ? are you fine ?");
var SearchResult = string.match(part);
if (SearchResult != null && part!="") {
alert("hello1");
}
string = $.trim("How are you ? a");
part = $.trim("How are you ? a");
SearchResult = string.match(part);
if (SearchResult != nu...
Before I look into doing this myself, is there already a function out there that will do this:
I want to pass in a string containing text and RegEx markup and then it returns all possible matches it would look for in a string.
so the following passed to the method
abc|def|xyz
Would return 3 strings in an array or collection:
abc
d...
I have a file with line: name, space and string of zero and one, and I need to extract every 5nth character of the string of zero and one, make a sum of the results and if the sum is not 0 - save the name into the other file.
1rt2 0001000000100000000000001010000100000000010000001000000100010010000000000000
1gh4 0001000000100000000000001...
I want my htaccess to redirect URL that end on ".html" to the index.php, but not any other files (so images can keep their href and still be displayed)
This is how my htaccess looks like now, it works for the HTML redirect, but styles or images are not displayed (because they are also redirected, I guess)
Options +FollowSymLinks
Rewrit...
I'm trying to match the highlighted parts of this string:
<iframe maybe something here src="http://some.random.url.com/" and the string continues...
I need to match the src="" if it's placed inside of an tag. The iframe tag can be placed anywhere in the source.
Thanks in advance! :)
...
To ensure data privacy, I have to publish a list of addresses after removing the street numbers.
So, for example:
1600 Amphitheatre Parkway, Mountain View, CA
needs to be published as
Amphitheatre Parkway, Mountain View, CA
What's the best way to do this in Java? Does this require regex?
...
final static private Pattern includePattern = Pattern.compile("^\\s+([^\\s]*)");
...
Matcher mtest = includePattern.matcher(" this.txt");
String ftest = mtest.group(1);
I get an exception No match found at java.util.regex.Matcher.group(Matcher.java:468)
I'm looking for at least 1 space character followed by a captured group of non...
In an earlier question I asked about sanitizing postal street addresses, one of the respondents recommended this solution:
addressString.replace(/^\s*[0-9]+\s*(?=.*$)/,'');
which is perhaps a valid regex call but is not valid in Java.
I unsuccessfully tried to make this valid Java code by changing it to the following:
addressString....
Hi Guys,
I have some problem with REGEXP and MYSQL.
How I cant ignore the accent on my string to compare with the regexp value?
SELECT ('estágio') REGEXP '(estagio)') AS dados
I cant remove the accent from the database.
I tried to convert to _bin or utf8_unicode_ci , but with no sucess.
Somebody has a tip for do that?
tks !
...
Hi
I have the following input values and I was hoping someone could kindly tell me the best way to match all of the "values" (217, 218, 219) -- The html is escaped and that's what I need to match.
<input type=\"hidden\" name=\"id\" value=\"217\"\/>
<input type=\"hidden\" name=\"id\" value=\"218\"\/>
<input type=\"hidden\" name=\"id\"...
I was wondering when one should use s/// over tr/// when working with regular expressions in Perl?
...