Questions tagged [string-search]

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

Use this tag for programming questions related to string searching algorithms.

Source: Wikipedia

261 questions
0
votes
1 answer

Should wild card characters (* and ?) be allowed for fieldMatching in elastic search?

I am getting a response if I search the details using wildCard characters in the elastic search for fieldMatch.Is this as expected?
0
votes
3 answers

how do I use ' string::find ' to find a word in file using C++

I'm creating a program that will open a file and search for a desired word within the text. I created the following word bank... Lawyer Smith Janes Doctor Michael Zane Teacher Maria Omaha #include #include #include…
Cris
  • 128
  • 3
  • 4
  • 17
0
votes
3 answers

Is there anyway I can compare a String (which is a word) and a letter which is input by the user and receive an output as a BOOL

I'm new to IOS dev and am making simple programs this one is a hangman game. I wanted to pick a random string from a plist file (completed). I now want to compare the user input text (from a text field) and compare it to the string we have randomly…
HairySocks
  • 13
  • 2
0
votes
3 answers

How to check for certain values in url

Is it possible to check if the url contains certain values, for instance if the URL "www.example.com/dummy1/dummy2/dummy3/en/dummy4/tim/" has an "en" or not. Thanks
freaky
  • 294
  • 4
  • 14
0
votes
3 answers

Get data out of string

I am going to parse a log file and I wonder how I can convert such a string: [5189192e][game]: kill killer='0:Tee' victim='1:nameless tee' weapon=5 special=0 into some kind of array: $log['5189192e']['game']['killer'] =…
0
votes
2 answers

String datastructure supporting append, prepend and search operations

I need to build a text editor as my mini project, and I need to design a data structure or algorithm that supports following operation: Append : Append a character at the end of the String. Prepend : Prepend a character at the beginning of the…
0
votes
4 answers

JS - go throught a text, make array entry after each "."

I'm new to JavaScript. I have a text with several sentences and I want each sentence to be an entry in a array named sentences and alert("new entry was made"). So I have to loop through and whenever there is a "." a new entry would start. But How…
daisy
  • 615
  • 2
  • 8
  • 15
0
votes
2 answers

How to search for HTML tags in multilpe strings with PHP?

Can you use strpos() searching for HTML tags? Seems to produce invalid results. Also tried converting to htmlentities() -- still no luck. How can I properly search for text decorations like: bold, italics, and underline? Example: (demo) /* HTML Tags…
Michael Ecklund
  • 1,206
  • 2
  • 17
  • 30
0
votes
2 answers

Searching for multiple words in C, and displaying the info after them seperated by commas

Let's say i have a txt file: Date: 11/11/11 Device: Boxster Status: Good I am trying to make my code search for a word (Say Device:), and display the info after that word (Boxster). So far i have the code working to only search for one word. How…
Dave Wang
  • 109
  • 4
  • 12
0
votes
2 answers

Search most right string in another string - in c

Possible Duplicate: Is there a reverse fn() for strstr I wrote this main and function that get two string and check if the second string exist within the first one, then return the most right index appear place. If wasn't found return -1. This is…
Yuval
  • 1,721
  • 4
  • 16
  • 15
0
votes
1 answer

search unique URL

Given a set of 1 million (very large) no. of URL's. Find the "first" "unique" URL from the list. My Approach: Build a hash using perfect hashing function, that can help. But my question is to hash large data is not possible., then how can I solve…
devsda
  • 4,112
  • 9
  • 50
  • 87
0
votes
1 answer

Find specific patteren of string in text

I'm searching for a way to find some specific patterens in text. For example if I would like to find all references from a text in format like this: Baron, Naomi (2000) Alphabet to Email: How Written English Evolved and Where It's Heading,…
MaticDiba
  • 895
  • 1
  • 11
  • 19
0
votes
2 answers

etree.ElementTree parses xml which then builds a tree, is it an efficiently-searchable data structure?

I have an XML string dave jones ron matthews sally van heerden tygervalley shopping and I would like to search this xml…
user1401950
  • 967
  • 2
  • 12
  • 28
0
votes
2 answers

Android autocompletetextview with approximate string matching

I am developing an application which has about 8000 names of the cities of India. And when the user types in i use auto complete to help the user to do the job. But some city names have spelling which is hard to guess for people from other states.…
Jeyanth Kumar
  • 1,589
  • 3
  • 23
  • 48
-1
votes
1 answer

find a text in elements of list if exists append it to a new list

list = ['0-0-0-0-0-4-0', '0-0-0-1-0-4-2', '0-0-3-0-0-80-0', '0-0-3-1-0-81-0', '0-0-3-0-0-82-0'] appendlist = ['0-0-3-0'] search for first 7 digit of element like that 0-0-3-0 occurance 2 times '0-0-3-0-0-80-0', '0-0-3-0-0-82-0' then if 11th-12th…
user289017
  • 15
  • 6