精华内容
下载资源
问答
  • VBA查询word中的字符

    千次阅读 2019-06-20 22:53:29
    Sub 查找相同字符个数() Text = InputBox("请输入您要查找到字符:", "信息提示") Dim result As String For i = 1 To 45 Text = "[" + Trim(str(i)) + "]" '注意数值转成字符串会在前面加上空格,所以要用trim...
    Sub 查找相同字符个数()
    Text = InputBox("请输入您要查找到字符:", "信息提示")
    
    Dim result As String
    
    
    For i = 1 To 45
    
    Text = "[" + Trim(str(i)) + "]"   '注意数值转成字符串会在前面加上空格,所以要用trim去除空格
    
    Text = Trim(Text)
     
    
    With ActiveDocument.Content.Find
    Do While .Execute(FindText:=Text) = True
    tim = tim + 1
    Loop
    End With
    
    '输出到字符串
    
    result = result + Text + "," + str(tim) + ";"
     
    tim = 0
    Next i
     
    '将结果写入到文本文件
     Call Write2Txt(result, "F:/24.txt")
    
    End Sub
    
    'fileAdress 如 C:/FSOTest/TestFile.txt
    Function Write2Txt(str As String, fileAdress As String)
        
        Dim sFile As Object, fso As Object
        Set fso = CreateObject("Scripting.FileSystemObject")
        
        Set sFile = fso.CreateTextFile(fileAdress, True)
        sFile.WriteLine (str)
         sFile.Close
         Set sFile = Nothing
         Set fso = Nothing
    End Function
    
    
    
    
    
    
     
    
    
    展开全文
  • 最近用到sqlserver的时候发现竟然没有Oracle的判断字符串出现次数的函数 而且网上给一般都有问题,如果我匹配的是两个字符串就不支持了...@Word判断字符串 len(replace(@WordAll,@Word,@Word+'_'))-len(@WordAll) ...

    最近用到sqlserver的时候发现竟然没有Oracle的判断字符串出现次数的函数
    而且网上给一般都有问题,如果我匹配的是两个字符串就不支持了
    最完美的解决办法如下
    @WordAll原字符串
    @Word判断字符串

    len(replace(@WordAll,@Word,@Word+'_'))-len(@WordAll)
    
    展开全文
  • 正则表达式应用:分析查询字符

    千次阅读 2013-09-04 11:18:02
    正则表达式作为一种分析技术,在很多地方都可以使用,最基础的可能人人都会。... http://www.baidu.com/s?word=test&tn=sitehao123&ie=utf-8  匹配查询字符串的正则表达式:\?(?([^&]+&?)+),

         正则表达式作为一种分析技术,在很多地方都可以使用,最基础的可能人人都会。再此通过一系列简单的例子讲解正则表达式。

        给定一个地址如何分析需要的数据,例如如下的网址,分析各个查询字符串

          http://www.baidu.com/s?word=test&tn=sitehao123&ie=utf-8

        基本思路是,

    1先得到?后边的部分,

    2再根据&和=分割


      1先得到?后边的部分,

        匹配查询字符串的正则表达式:\?(?<querystring>([^&]+&?)+),去掉命名部分的正则表达式为:\?([^&]+&?)+ 匹配到'?word=test&tn=sitehao123&ie=utf-8

        \?([^&]+&?)+具体含义 :

              \?表示已 ?开头,由于?在正则表达式的中有特殊含义,所以需要一个斜杠 \转义。

              [^&]+表示匹配不是&的任意一个或者多个字符

             &? 表示&出现一次或者不出现

          \?([^&]+&?)+的整体含义就是

             1匹配以?开头

              2 

                2.1匹配不是&的多个字符

                2.2匹配&一个或者没有

                2.3 重复2.1,2.2一次或者多次

            3 把(([^&]+&?)+)部分匹配到的字符命名为querystring则正则表达式变为:\?(?<querystring>([^&]+&?)+)


    2再根据&和=分割

    分析查询字符串的正则表达式为:((?<key>[^&=]+)=(?<value>[^&=]+))+,去掉命名部分的正则表达式为:(([^&=]+)=([^&=]+))+

                 [^&=]+表示匹配不是&=的任意一个或者多个字符    

       (([^&=]+)=([^&=]+))+的整体含义就是

          1匹配不是&=的任意一个或者多个字符

           2匹配等号=

           3匹配不是&=的任意一个或者多个字符

          4重复以上1,2,3

        把1匹配到的字符命名为key,把3匹配到的字符命名为value,则正则表达式变为((?<key>[^&=]+)=(?<value>[^&=]+))+


    测试的代码如下:

      private static void Test() 
            {
                string url = "http://www.baidu.com/s?word=test&tn=sitehao123&ie=utf-8";
                  Regex reg = new Regex(@"\?(?<querystring>([^&]+&?)+)");          
                  Match m =  reg.Match(url);
                  string querystring = m.Groups["querystring"].Value;
                  Regex reg2 = new Regex(@"((?<key>[^&=]+)=(?<value>[^&=]+))+");
                  Dictionary<string, string> querystringKeyValue = new Dictionary<string, string>();
                  foreach (Match item in reg2.Matches(querystring))
                {             
                  querystringKeyValue.Add(item.Groups["key"].Value, item.Groups["value"].Value);             
                }
            
            }


         

       


    展开全文
  • 642 - Word Amalgamation Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=583 In millions of newspapers across the United States there

    642 - Word Amalgamation

    Time limit: 3.000 seconds

    http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=583

    In millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, but in order to find the letters that appear in the answer it is necessary to unscramble four words. Your task is to write a program that can unscramble words.

    Input 

    The input file contains four parts:

    1.
    a dictionary, which consists of at least one and at most 100 words, one per line;
    2.
    a line containing XXXXXX, which signals the end of the dictionary;
    3.
    one or more scrambled `words' that you must unscramble, each on a line by itself; and
    4.
    another line containing XXXXXX, which signals the end of the file.

    All words, including both dictionary words and scrambled words, consist only of lowercase English letters and will be at least one and at most six characters long. (Note that the sentinel XXXXXX contains uppercaseX's.) The dictionary is not necessarily in sorted order, but each word in the dictionary is unique.

    Output 

    For each scrambled word in the input, output an alphabetical list of all dictionary words that can be formed by rearranging the letters in the scrambled word. Each word in this list must appear on a line by itself. If the list is empty (because no dictionary words can be formed), output the line ``NOT A VALID WORD" instead. In either case, output a line containing six asterisks to signal the end of the list.

    Sample Input 

    tarp
    given
    score
    refund
    only
    trap
    work
    earn
    course
    pepper
    part
    XXXXXX
    resco
    nfudre
    aptr
    sett
    oresuc
    XXXXXX
    

    Sample Output 

    score
    ******
    refund
    ******
    part
    tarp
    trap
    ******
    NOT A VALID WORD
    ******
    course
    ******

    统统排序。


    完整代码:

    /*0.015s*/
    
    #include<cstdio>
    #include<cstring>
    #include<algorithm>
    using namespace std;
    
    char word[110][10], sorted[110][10], s[10];
    char *pstr[110];
    
    bool cmp_string(const char *a, const char *b)
    {
    	return strcmp(a, b) < 0;
    }
    
    int main(void)
    {
    	int n = 0;
    	while (gets(word[n]), word[n][0] != 'X')
    	{
    		pstr[n] = word[n];
    		++n;
    	}
    	///交换两个字符串数组?干脆交换指针吧。
    	sort(pstr, pstr + n, cmp_string);
    	///注意在排序之后,word的顺序并未改变,但sorted是字典序
    	for (int i = 0; i < n; i++)
    	{
    		strcpy(sorted[i], pstr[i]);
    		sort(sorted[i], sorted[i] + strlen(sorted[i]));
    	}
    	while (gets(s), s[0] != 'X')
    	{
    		sort(s, s + strlen(s));
    		bool found = false;
    		for (int i = 0; i < n; i++)
    			if (strcmp(sorted[i], s) == 0)
    			{
    				found = true;
    				puts(pstr[i]);
    			}
    		if (!found)
    			puts("NOT A VALID WORD");
    		puts("******");
    	}
    	return 0;
    }
    

    展开全文
  • 后来上网了下,原来是因为输入法中的半角与全角输入对于英文输入存在差别,简单的说就是在在计算机中一个英文字符所占位置称为“半角”,相对的中文字符在需占两个英文字符的位置,称为“全角”;“全角...
  • Solr过滤器查询字符

    2015-10-09 15:02:36
    I am also trying to include a word search on a field using <pre><code>$solr_dao->set_filter_query('Comments:[*'.$search_term.'*]'); </code></pre> <p>which doesn't seem to be working. This query ...
  • word查询之使用通配符

    2014-05-05 15:06:00
    ” 代表任意单个字符,输入几个“?”就代表几个未知字符。 比如我们输入“?国”就可以找到诸如“中国”、“美国”、“英国”等字符;输入“???国”可以找到“孟加拉国”等字符。 2、“*”可以代表任意多个字符。 ...
  • <p>Just getting to grips with this jquery and ajax thing.... <p>I want to run a small ...<p>the <code>drag_item.attr('id')</code> is a small one word text, is that the right way of doing it? </div>
  • 1.本文的安全检查免费软件计算的单词总数为Word统计信息的文字(计数间隔),不仅是Word统计信息的单词数。免费重复率的话,文件表的汉字也会计算。各论文有英语和英语的参考文献摘要。这些英语摘要占了更多的文字。...
  • so basically its finding all complete matching terms individual matching terms and skipping over any entry that may match but has a non-match word in it and of course the entry where nothing matches....
  • <p>When user input space or nothing in the input bar, a plus sign + is still passed to my php backend. I would want to remove all plus signs before and after a word (e.g. return 'school' from '+++...
  • 将该空白字符从Excel中复制到Word中,选中该字符(空白),按Alt+X组合键,则在Word中显示出了该字符的Unicode代码为:F0A7 那么这个“F0A7”字符到底是个何方神圣呢?发现了以下这个不错的网页,信
  • 在这里插入代码片 #include &lt;stdio.h&gt; #include &lt;stdlib.h&...函数名称:字符串查询 函数说明:1.字符串常量可以直接赋值给指针...const char *key_word[] = {“do”,“for”,“if”,“re...
  • 根据传入的字符串和数组,返回数组中相似度最高的字符串 1. PHP代码如下:  function closest_word($input, $words) { $shortest = -1; foreach ($words as $word) { $lev = levenshtein($input, $word); if ...
  • &lt;!-- 根据hid,hanme,grade,模糊查询医院信息--&gt; 方法一: ...) String selectword); &lt;select id="getHospitalLike" resultType="com.hand.hand.domain.Hospita...
  • 不过一般在txt java jsp等文件中查询,word xml等文件中的中文现在还没法查询 //查询特定的字符串 并将包含该字符串的文件的信息保存到myFIles中 public void getSpecificStr(List files, String spec...
  • <p>but this code just show duplicated result, indeed for each word it shows 5 results then for another word another 5 result and... i need to search db for words one by one, but at last show just 5 ...
  • DECLARE @word VARCHAR(2000);DECLARE @word VARCHAR(2000); SELECT @word = 'I do not like to get the news, because there has never been an era when so many things were going so right for so many ...
  • http://www.pgygho.com/help/soft/word/33853.html 首先选择单个字符,然后按下 alt + x 可以查询对应字符的编码,我感觉这个小功能有时候可能会非常有用。希望您能考虑这个小功能 </p><p>该提问...
  • grep 查询多个字符

    万次阅读 2014-05-15 14:39:55
    ① grep -E "word1|word2|word3" file.txt  满足任意条件(word1、word2和word3之一)将匹配。 ② grep word1 file.txt | grep word2 |grep word3  必须同时满足三个条件(word1、word2和word3)才匹配。
  • <p>If the word is repeated in more than on sentence i will need to retrieve both sentences. I'm not sure if im explaining it well; please comment and I will try to explain it again. <p>EDIT <p>I ...
  • like concat(#{selectword},'%')
  • mysql查询结果拼接成字符

    万次阅读 2015-06-15 12:30:04
    SELECT GROUP_CONCAT(at_id) AS xg FROM (SELECT at_id,COUNT(at_id) AS count FROM wyc_at_word WHERE word_id in (SELECT word_id FROM wyc_at_word WHERE at_id = 1 AND at_id != 1 GR
  • SQL查询中文字首字符

    2015-04-01 11:20:51
    RETURN NLSSORT(P_WORD, 'NLS_SORT=SCHINESE_PINYIN_M'); END; BEGIN FOR I IN 1 .. LENGTH(P_NAME) LOOP V_CHARACTER := SUBSTR(P_NAME, I, 1); V_COMPARE := F_NLSSORT(V_CHARACTER);...
  • oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 第一章 Oracle入门 一、 数据库概述 数据库(Database)是按照数据结构来组织、存储和管理数据的仓库,它产生于距今五十年前。简单来说是本身可视...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 617
精华内容 246
关键字:

word查字符