Regular expressions are a declarative language, mainly used for pattern matching within strings.

learn more… | top users | synonyms

0
votes
1answer
33 views

Change in core drupal module regex security risk

As interim solution to an issue in javascript I changed in Core Drupal user.module file line, to disallow single quotation mark: if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)) { to if ...
0
votes
0answers
56 views

Using a regex as argument for a view

I currently have a view with an argument. $handler->override_option('arguments', array( 'title' => array( 'default_action' => 'not found', 'style_plugin' => 'default_summary', ...
2
votes
1answer
122 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
180 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"; ...
1
vote
1answer
120 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
209 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
95 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
703 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
489 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)) { ...