Note that there are some explanatory texts on larger screens.

plurals
  1. POmatching between array and content of file without using regex
    primarykey
    data
    text
    <p><strong>please possible make matching between array and content of file without using regex.</strong> </p> <p><em><strong>please replay</em></strong>:-</p> <p>if i have a txt file contain this sentences:</p> <pre><code>the sql is the best book for jon. book sql is the best title for jon. the html for author asr. book java for famous writer amr. </code></pre> <p>and if i stored this string in array;</p> <pre><code>sql html java jon asr amr </code></pre> <p>I want to search for content of array in the file for example if "sql" and"jon" in the same sentence in the txt file then write the sentence and </p> <p>write all word before "sql" named as <strong>prefix</strong> and all word between two "sql" and"jon" and named as <strong>middle</strong> and all word after "jon"named as <strong>suffix</strong>.</p> <p>I try to write cod : </p> <pre><code>String book[][] = {{"sql","html","java"},{"jon","asr","amr"}}; String input; try { BufferedReader br = new BufferedReader(new FileReader(new File("sample.txt") )); input= br.readLine(); while ((input)!= null) { if((book[0][0].contains(input))&amp;( book[1][0]).contains(input)){ System.out.println(); if((book[0][1].contains(input))&amp;( book[1][1]).contains(input)){ System.out.println(); if((book[0][2].contains(input))&amp;( book[1][2]).contains(input)){ System.out.println(); } else System.out.println("not match"); }} }} catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>i don't know how to write code to extract prefix,middle and suffix</p> <p>the output is:</p> <pre><code>the sentence is : the sql is the best book for jon. prefix is :the middle is:is the best book for suffix is: null </code></pre> <p>and so on...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload