2011-12-14 7 views
1

例として2つの文字列があり、両方の文字列のTEXTがEXACTであるかどうかを確認したいと思います.STRINGが一致しない場合はSTRINGまたは元の文字列。jQueryまたはPHPを使用したテキストの比較

jQueryでも可能ですか?任意のコード?

私はオンラインテキスト比較ツールの多くを使用しようとしましたが、それらのどれも、以下の文字列が正確であり、違いがないことを言っていない、段落

テキスト1

In this chapter, you learn some real time-savers. If you are tired of defining 
the same layers, along with units, grid, snap, and ltscale, for each new 
drawing, read on. You are about to learn how to create your own template 
drawings. With templates, you can begin each new drawing with setups 
you have defined and saved in previous MEMA sessions, or with a 
variety of predefined setups included in the software. 
In addition, you learn to reshape the grid using the LIMITS command 
and to copy, move, and array objects on the screen so that you 
do not have to draw the same thing twice. We begin with the LIMITS 
command, because we want to change the limits as part of defining 
your first template. 
を無視する必要があります

テキスト2

In this chapter, you learn some real time-savers. If you are tired of defining the same layers, along with units, grid, snap, and ltscale, for each new drawing, read on. You are about to learn how to create your own template drawings. With templates, you can begin each new drawing with setups you have defined and saved in previous MEMA sessions, or with a variety of predefined setups included in the software. 
In addition, you learn to reshape the grid using the LIMITS command and to copy, move, and array objects on the screen so that you do not have to draw the same thing twice. We begin with the LIMITS command, because we want to change the limits as part of defining your first template.** 
+0

「次の文字列は正確です」/「違いはありません」...しかし、「段落などを無視する必要があります」。どちらですか? "etc"とは何ですか? _thorough_および_precise_問題指定を記述してください。 –

+0

ありがとうございます。オンラインツールのどれも、同じ内容ではないと言います – user580950

答えて

4

"Diff"実装を探していますが、それはまったく簡単なことではありません。 PHPとJavaScriptの両方で可能です。

これらのSOの質問を参照してください:詳細を見つけるために

を:

+0

私はそれを試しましたが、ツールのどれもが役に立ちません – user580950

+0

@userよく、あなたが実際に示している2つの文字列は全く同じではありません。最も簡単な方法は、おそらく比較を行う前に改行を削除することです –

関連する問題