I have a simple commenting system here...
http://affbuzz.com/comments/7299a55137def55917a5dc6c4fe0f261af8a4217
...and people can submit hyperlinks inside the plain text field. When I display these records back from the database and into the web page, what RegExp in PHP can I use to convert these links into HTML-type anchor links?
Bonu...
A simple (I hope) regex question:
I have several pages where I need to replace every document.all['string'] with document.getElementById('string').
I can use Visual Studio or Notepad++ to replace regular expressions, I just need the right ones.
Thanks for any assistance,
Guy
...
I have the following regexp
var value = "hello";
"(?<start>.*?\W*?)(?<term>" + Regex.Escape(value) + @")(?<end>\W.*?)"
I'm trying to figure out the meaning, because it doesnt work against the single word.
for example, it matches "they said hello us", but fails for just "hello"
can you please help me to decode what does this regexp st...
This is probably simple, but I can't figure this out:
I need regex expression which would extract following records (Each record may span multiple lines and delimited by one or more blank lines):
TextTextTextTextTextTextText
TextTextTextTextTextTextTextTextText
(one or more blank lines)
TextTextTextTextText
TextTextText
TextTextTex...
Hi.
I face some problem.
In my string there can be a special character / newline '\r\n'
Part of my regex:
string sRegex = "(?<string>\"+.*\"|'+.*')";
How I should modify this regex to exclude newline from my string?
Thanks for help.
...
In a follow-up to this question, I need to compare two strings in a case-insensitive manner, ignoring any non-alphanumeric characters except the comma and the semicolon, in JavaScript. So
Times New Roman, Times, Sans-Serif
matches
Times New Roman,Times,SansSerif
Can somebody get me started with the right function/approach? Is there...
Hi
I searching for fast and safe way to apply Regular Expressions on Streams.
I found some examples over the internet that talking about converting each buffer to String and then apply the Regex on the string.
This approach have two problems:
Performance: converting to strings and GC'ing the strings is waste of time and CPU and sure...
My Problem
I'm attempting to crawl the individual links on the US House of Representatives Site to find Washington addresses for all of the listed individuals. The problem is that the format of the Washington address varies from time to time. Sometimes there are bullets, pipes, new lines and break-tags making it difficult to match.
I...
Why this expression is not following greedy approach?
string input = @"cool man! your dog can walk on water ";
string pattern = @"cool (?<cool>(.*)) (?<h>((dog)*)) (?(h)(?<dog>(.*))) ";
MatchCollection matches = Regex.Matches(input, pattern, RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.IgnorePatternWhitesp...
Hi all,
I need to detect search engines that refers to my website. Since every search engine has different query strings for searching(e.g. google uses 'q=', yahoo uses 'p=') I created a database for search engines with their url regex patterns.
As an example:
http://www.google.com/search?q=blabla&ie=utf-8&oe=utf-8&aq=t&...
Are there any (free) regular expression engines for Java, that can compile a regular expression to a DFA, and do group capturing while matching the DFA ?
I've found dk.brics.automaton and jrexx, which both compile to DFA, but neither seems to be able to do group capture. While the other engines I've found seem to compile to NFA.
...
Hi!
I need something like this...
stored value in DB is: 5XXXXXX [where x can be any digit]
and i need to match incoming SQL query string like... 5349878.
Does anyone has an idea how to do it?
i have also different cases like XXXX7XX for example,
so it has to be generic.
i don't care to represent the pattern in a differnet way ins...
I'm looking for a simple regex exp that will validate a 10 digit phone number. I'd like to make sure that the number is exactly 10 digits, no letters, hyphens or parens and that the first two digits do not start with 0 or 1. Can someone help out?
...
Hi,
I'd like to implement a RegExp (regular expression) that can check a string to see if it contains "http://" (i.e. it contains a URL), and then take that whole URL into a new string variable. The string I am using is not HTML, it is simply text with any arrangement of words, characters, numbers and URLs.
I'd imagine I'd look for a m...
Just checking if anyone knows of a tool for describing programmatically a RegEx type problem, for it to then be translated into a RegEx.
What I mean by this is: can any tool take more human readable code/language and convert it to the fairly impenetrable RegEx expressions?
If not: someone really ought to do this! Would be incredibly us...
Source:
[This] is some text with [some [blocks that are nested [in a [variety] of ways]]]
Resultant text:
[This] is some text with
I don't think you can do a regex for this, from looking at the threads at stack overflow.
Is there a simple way to to do this -> or must one reach for pyparsing (or other parsing library)?
...
I have a problem with my RegEx. I want to translate a BBCode Link like
[link=www.stackoverflow.com]Stack-Overflow[/link]
into a HTML Link like
<a href='www.stackoverflow.com'>Stack-Overflow</a>.
In my String it's possibile to make more than one link in BBCode.
I Also need a function to translate the html back to BBCode.
My f...
i need to validate this type of string
0415256987, 0452 654 987, 0411 236589, 0 410 258 987 etc.
each number has 10 digits and spaces commas, new line, are allowed.
in my project this is a textarea where users enter comma delimited string of mobile numbers.
the regex is for the js validation.
the spaces and new lines are allowed to...
Hi guys.
How to check a line ($_ value) is a blank line in perl?
or other good method to check it instead of using $_
I want to code like this
if ($_ eq '') # Check current line is a blank line (no any characters)
{
$x = 0;
}
Thank you.
Updated some code with question solution below
my test.txt for ...
I've searched for questions like this, but all the cases I found were solved in a problem-specific manner, like using !g in vi to negate the regex matches, or matching other things, without a regex negation.
Thus, I'm interested in a “pure” solution to this:
Having a set of strings I need to filter them with a regular expression matche...