recursive-regex

RegEx to randomly set case of characters in a string

What I'm looking for is a RegEx to mix the character case of a given string for use in functional testing. Example Input: The Quick Brown fox jumps over the Lazy Dog. Sample Expected Output: tHe QUiCk BrOwn FoX jUMPs OvER tHe lAzY dOg. It would be nice if the output was different every time the RegEx were applied. For example, giv...

Java regex library with recursion support

Hi, I am looking for a Java regexp lib with support for recursion, like: "<a+(?0)>" JDK does not support it, ORO does neither. Anyone knows about such? Thanks, Ondra Edit: See http://www.php.net/manual/en/regexp.reference.recursive.php And I need it for this expression: (?:mUi)^/--++ *+(.*)(?: *(?<= |^)\\.((?:\\([^)\\n]+\\)|\\[[...

How to match the coupled string with regular expression?

I want to match this kind of format: AA sysodufsoufdds AA Where AA can be arbitary consecutive string with no space in it. Is there a solution? ...

Converting PCRE recursive regex pattern to .NET balancing groups definition

PCRE has a feature called recursive pattern, which can be used to match nested subgroups. For example, consider the "grammar" Q -> \w | '[' A ';' Q* ','? Q* ']' | '<' A '>' A -> (Q | ',')* // to match ^A$. It can be done in PCRE with the pattern ^((?:,|(\w|\[(?1);(?2)*,?(?2)*\]|<(?1)>))*)$ (Example test case: http://www.ideone.com/...

Recursive regex

Hi there ! I have the following string in php: $string = 'FEDCBA9876543210'; The string can be have 2 or more (I mean more) hexadecimal characters I wanted to group string by 2 like : $output_string = 'FE:DC:BA:98:76:54:32:10'; I wanted to use regex for that, I think I saw a way to do like "recursive regex" but I can't remember i...

Regular expression crashes Apache due to PCRE limitations. Need some help optimising!

Hey there. I am currently creating bbcode parsing engine and I have encountered a situation what i can't figure out on my own. The thing is, that I popped into a problem exactly like this one: http://stackoverflow.com/questions/3457039/apache-php-on-windows-crashes-with-regular-expression That means that if i make something like the ex...

Why will this recursive regex only match when a character repeats 2^n - 1 times?

After reading polygenelubricants's series of articles on advanced regular expressions techniques (particularly How does this Java regex detect palindromes?), I decided to attempt to create my own PCRE regex to parse a palindrome, using recursion (in PHP). What I came up with was: ^(([a-z])(?1)\2|[a-z]?)$ My understanding of this expr...

What reg expression patten to I need to match everything between {{ and }}

What reg expression patten to I need to match everything between {{ and }} I'm trying to parse wikipedia, but im ending up with orphan }} after running the rexex code. Here's my PHP script. <?php $articleName='england'; $url = "http://en.wikipedia.org/wiki/Special:Export/" . $articleName; ini_set('user_agent','custom agent'); //requi...

Nested regex... I'm clueless!

Hi all, I'm pretty clueless when it comes to PHP and regex but I'm trying to fix a broken plugin for my forum. I'd like to replace the following: <blockquote rel="blah">foo</blockquote> With <blockquote class="a"><div class="b">blah</div><div class="c"><p>foo</p></div></blockquote> Actually, that part is easy and I've already part...

Regex to parse functions with arbitrary depth

I'm parsing a simple language (Excel formulas) for the functions contained within. A function name must start with any letter, followed by any number of letters/numbers, and ending with an open paren (no spaces in between). For example MyFunc(. The function can contain any arguments, including other functions and must end with a close ...