Hi all,
I have a little script that replace some text, that come from a xml file, this is an example:
<b>Hello world,</b>
<include file="dynamiccontent.php" />
<img src="world.png" />
a lot of <i>stuff</i>
Obviosly the string is much more longer, but I would like to replace the <include
file="*" /> with the content of the script in t...
Hi All,
i have been looking for ages for a regular expression which will return all page titles. unfortuantley some have newline tags in them and other wiered stuff which is preventing me from finding a result.
here are some of the regex's i have tried
"/\<title.*\>(.+)\<\/title\>/"
"#\<title.*\>(.+)\<\/title\>#s"
but none of th...
Sorry, I know this is probably a duplicate but having searched for 'python regular expression match between' I haven't found anything that answers my question!
The document (which to make clear, is a long HTML page) I'm searching has a whole bunch of strings in it (inside a JavaScript function) that look like this:
link: '/Hidden/Side...
I can see how two values, when doing a regular/fuzzy full text search, can be compared to determine which one is "better" (i.e. one value contains more keywords than the other, one contains less non-keywords than the other).
However, how Lucene computes the score when doing regex queries using RegexQuery? It is a boolean query - a field...
Using PHP, I'm trying to improve the search on my site by supporting Google like operators e.g.
keyword = natural/default
"keyword" or "search phrase" = exact match
keyword* = partial match
For this to work I need to to split the string into two arrays. One for the exact words (but without the double quotes) into $Array1() and put e...
here is some code:
>>> p = re.compile(r'\S+ (\[CC\] )+\S+')
>>> s1 = 'always look [CC] on the bright side'
>>> s2 = 'always look [CC] [CC] on the bright side'
>>> s3 = 'always look [CC] on the [CC] bright side'
>>> m1 = p.search(s1)
>>> m1.group()
'look [CC] on'
>>> p.findall(s1)
['[CC] ']
>>> itr = p.finditer(s1)
>>> for i in itr:
... ...
['abc','xyz'] – this string I want turn into abc,xyz using regex in javascript. I want to replace both open close square bracket & single quote with empty string ie "".
...
I need to remove special characters from the posted data. It may be possible by using Regular Expressions or may be other. How to strip the special characters. Plz help
...
I'm trying to replicate CI's humanize() and underscore() function in Javascript.
From the CI documentation, underscore() takes multiple words separated by spaces and underscores them while humanize() takes multiple words separated by underscores and adds spaces between them. The CI implementation looks something like:
function unders...
I am trying to break my app into separate scripts. Part of this effort meant breaking the api calls into it's own file. However the calls to the api (like http://example.com/api/game/new no longer work).
My app.yaml contains this:
- url: /api.*
script: api.py
which seems to be redirecting properly because this configuration works:
...
A while ago, I saw in regex (at least in PHP) you can make a capturing group not capture by doing prepending ?:.
Example
$str = 'big blue ball';
$regex = '/b(ig|all)/';
preg_match_all($regex, $str, $matches);
var_dump($matches);
Outputs...
array(2) {
[0]=>
array(2) {
[0]=>
string(3) "big"
[1]=>
string(4) "ball"
...
Sir,
I want regular expression for indian mobile numbers which consists of 10 digits.
The number's which should match start with 9 or 8 or 7.
i.e. 9882223456 , 8976785768 , 7986576783
it should not match the numbers starting with 1 to 6 or 0.
Thank you in advance.
...
I need help to create a regex (for JavaScript .match and PHP preg_match) that validates a unix type absolute path to a file (with international characters such as åäöøæð and so on) so that:
/path/to/someWhere is valid
/path/tø/sömewhere is valid
/path/to//somewhere is invalid
path/to/somewhere is invalid
/path/to/somewhere/ is invalid
...
i have a string value that needs to be parsed with a regular expression...it may contain words, numbers and special chars in any order...what is the easiest expression for that...
...
Hi Experts,
I have the following regex in my .htaccess file
RewriteRule ^suppliers/category/([\w\s-\/]*)$ /index.cfm?ct=suppliers.home/category/$1 [nc]
For some reason this code is not picking up the forward slash properly. e.g.
for the following url http://mydomainname.co.uk/suppliers/category/Archive/records%20Management I would e...
I have the following sample template code.
{# @T('core.layout:Logged in as {0} {1}', @user('firstname'), @user('lastname')) #} {# VAR_TEST #}
And the following regex used to parse for the tags
/{# (\@)?(([A-Z][^#}]+)|(([a-zA-Z0-9\_]+)?\(([^#}]*)\))) #}/
However it only matches the last tag because of the close curly braces (}) in t...
I have the following Perl script counting the number of Fs and Ts in a string:
my $str = "GGGFFEEIIEETTGGG";
my $ft_count = 0;
$ft_count++ while($str =~ m/[FT]/g);
print "$ft_count\n";
Is there a more concise way to get the count (in other words, to combine line 2 and 3)?
...
I want to split a string with "?" as the delimitter.
str.split("?")[0] fails.
...
I need to tokenize following tag:
{TagName attrib1=”value1” attrib2=”value 3”}.
I would like to write regex to do it, but the trouble is that attribute value can contain space, so I can’t just split with space.
...
I'm working with a legacy Java app that has no logging and just prints all information to the console. Most exceptions are also "handled" by just doing a printStackTrace() call.
In a nutshell, I've just redirected the System.out and System.error streams to a log file, and now I need to parse that log file. So far all good, but I'm havi...