This is the regex to validate email address in javascript,I'm not sure if I can just use it directly in PHP:
/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\...
Howdy,
I'm trying to come=up with a regex string to use with the PHP preg functions (preg_match, etc.) and am stumped on this:
How do you match this string?:
{area-1}some text and maybe a <a href="http://google.com">link</a>.{/area-1}
I want to replace it with a different string using preg_replace.
So far I've been able to...
I'm learning awk and I have trouble passing a variable to the script AND using it as part of a regex search pattern.
The example is contrived but shows my probem.
My data is the following:
Eddy Smith 0600000000 1981-07-16 Los Angeles
Frank Smith 0611111111 1947-04-29 Chicago
Victoria McSm...
The problem: I'm trying to style certain keywords (e.g. "function") within the content of a code-tag, excluding those keywords from the C-style comments that appear in that content.
Solution: I believe that a match of the innerHTML-string of the code-tag against a Regex-pattern, that would exclude the C-style comments could do the job.....
Hello,
Now i have a json code like this:
{"1":
{
"text":"e1",
"children":
{
"1":
{
"text":"e1_site1",
"children":
{"1":"e1_site1_salarie1_nom"}
},
"3":
{
"text":"e1_site2",
"children":
...
I'm grabbing a list of tags used on a post with the $posttags array. In this there's a special tag that I want to store separately: profile-somename.
How do I:
Find this special profile-somename tag from the list (The value after profile- is dynamic, keeps changing, somename is just an example)
Strip profile- from it and
Store in a ...
I need a regular expression in javascript which does the following.
Those instances of a which are not the part of an HTML entity, should be replaced with w.
Ex:
abc should change to wbc
aabacaa should change to wwbwcww
&abcaa& should change to &wbcww&
and so on.
I am using JavaScript.
Any help is appr...
I am having some trouble escaping a validation expression within a regular expression validator in XSLT.
<asp:RegularExpressionValidator ID="regValEmail" ErrorMessage="..." runat="server" ValidationGroup="Store"
ValidationExpression="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\....
Given the function name and the number of how many parameters the function has, how to list all the function definitions using egrep and regex?
For example, the name of the function is "find" we are expected to find those functions "find" that have just three parameters, no more and no less like the following:
sometype find ( type1 pa...
Hi,
I've been trying to formulate a regular expression to remove any attributes that may be present in html tags but I'm having trouble doing this and Google doesn't seem to provide any answers either.
Basically my input string looks something like
<p style="font-family:Arial;" class="x" onclick="doWhatever();">this text</p>
<img st...
How would you parse in Java a structure, similar to this
\\Header (name)\\\
1JohnRide 2MarySwanson
1 password1
2 password2
\\\1 block of data name\\\
1.ABCD
2.FEGH
3.ZEY
\\\2-nd block of data name\\\
1. 123232aDDF dkfjd ksksd
2. dfdfsf dkfjd
....
etc
Suppose, it comes from a text buffer (plain file).
Each line of text is "...
I want a regex that will match:
A type with an ID:
[Image=4b5da003ee133e8368000002]
[Video=679hfpam9v56dh800khfdd32]
With between 0 and n additional options separated with @:
[Image=4b5da003ee133e8368000002@size:small]
[Image=4b5da003ee133e8368000002@size:small@media:true]
I have this so far :
\[[a-zA-Z]*=[a-zA-Z0-9]*[@[a-zA-Z]*:...
Context
Using Ruby I am parsing strings looking like this:
A type with an ID...
[Image=4b5da003ee133e8368000002]
[Video=679hfpam9v56dh800khfdd32]
...with between 0 and n additional options separated with @...
[Image=4b5da003ee133e8368000002@size:small]
[Image=4b5da003ee133e8368000002@size:small@media:true]
In this example:
[Im...
I am trying to figure out how to create a function where I can pass in two strings, one with wildcards and another that is checked to see if it matches the wildcard string.
$wildcard_string = '*.example.com/some/path/*';
$test_string = 'dev.example.com/some/path/art123.html';
function test_wildcard_match($wildcard_string, $test_string...
Does anyone have a good regex for stripping all symbols (';.,_\$@!% the carriage return etc) from a string, without damaging any foreign characters (é 多 فا etc)? Non-regex would be even better, I suppose, but I don't see any Ruby or Rails methods that do this.
...
I'm new to JavaScript and regular expression. I'm trying to automatically format a text document to specific number of characters per line or put a "\r" before the word.
This is functionally similar to Wordwrap found in numerous text editors.
Eg. I want 10 characters per line
Original:My name is Davey Blue.
Modified:My name \ris Dave...
Hi, I'm trying to split a string into tokens (via regular expressions)
in the following way:
Example #1
input string: 'hello'
first token: '
second token: hello
third token: '
Example #2
input string: 'hello world'
first token: '
second token: hello world
third token: '
Example #3
input string: hello world
first token: hello
second t...
What does this regular express mean. It is in an XML schema that I am using:
([!-~]|[ ])*[!-~]([!-~]|[ ])*
-Dave
...
Hi There
I need some help with a regular expression, please help if you can
I have the following code: I am using Javascript and ASP
{In|inside|during|into|in the sphere
of} {this} {article|piece of
writing|editorial|commentary|paragraph|section}
{we} {will|desire to|wishto|want
to|resolve to|will} {tell} {you}
{more} {ab...
Hello all,
I have got stuck with a question I have just been helped on - its a new problem but only just slightly.
I have this preg_match to get the contents of href. Please don't tell me not to use regex - I am aware of using other parsers/classes etc but this is an old script that just needs to be fixed for now. :) No time for re-wri...