Regular expressions are a declarative language, mainly used for pattern matching within strings.
2
votes
1answer
38 views
How to redirect all images in the files folder to a default file?
Because we work with DTAP environments, our developers work on their own laptops. To get a good view of the live environment, we copy the PROD database and the files to our own laptop. However, this ...
0
votes
1answer
78 views
regex works in PHP fiddle but not in Drupal
I am having a problem getting some regex to work in Drupal. The below regex works fine:
<?php
$test = "1111~~test1<>2222~~test2<>3333~~test3<>44444~~test4<>11112~~test5";
...
0
votes
0answers
55 views
How to block certain tld using spam module?
Using the Spam module, I have tried to define filters to block posts containing domains of type .tk because they are mostly spam. The regular expression filters I've used are the following:
'tk'
...
1
vote
1answer
80 views
Regex Jquery in Drupal 7 not working [closed]
(I have posted this on Stack Exchange as well)
I have a Drupal 7 page on which I need to remove text bracketed by "Keywords:" and "Description:", there are a number of text blocks all with the class ...
2
votes
0answers
89 views
Text comparison rules on node:body:value with input filters
My text comparison rule works like a charm if the user selects 'Plain text'. If they use 'Filtered HTML' it doesn't find a match even though the pattern does exist in the raw and filtered versions of ...
0
votes
1answer
65 views
How do you replace text surrounded by a custom delimeter with <span> around it?
Overview
I want to have action asterisks in my posts. Basically, asterisks surrounding certain words. Examples: *gasp* or *giggle*
Simple enough. Now I could type that exactly into the editor but it ...
0
votes
1answer
456 views
Use Regex to insert jQuery querystring before a url anchor
On my page I have some content links that start with '/example/'. I'm using jquery to add a querystring to these links, which is the parent of the currently viewed node. So, the code looks like ...
1
vote
4answers
365 views
Email validation '+' not accepting
I have written email validation as follow.
if($email != ''){
if (!ereg("^[_a-zA-Z0-9]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})$",$email)) {
...
