in Education by
const string strRegex = @"(?.+) ?(bis|zu)? (?[\d.,]+) eur"; searchQuery = RemoveSpacesFromString(searchQuery); Regex regex = new Regex(strRegex, RegexOptions.IgnoreCase); Match m = regex.Match(searchQuery); ComplexAdvertismentsQuery query = new ComplexAdvertismentsQuery(); if (m.Success) { query.CountryName = m.Groups["city_country"].Value; query.CityOrAreaName = m.Groups["city_country"].Value; query.PriceFrom = Convert.ToDecimal(1); query.PriceTo = Convert.ToDecimal(m.Groups["price"].Value); } else return null; return query; my search string is "Agadir ca. 600 eur" but "ca." is not "bis" or "zu" and regex is also true. What is wrong with regex? I want that regex is true only if is word "bis" or "zu". I think this is worng ?(bis|zu)? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Agadir ca. becomes your city_country and (bis|zu)?part is skipped as you've marked it as not required with ?.

Related questions

0 votes
    const string strRegex = @"(?.+) ?(bis|zu)? (?[\d.,]+) eur"; searchQuery = ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    const string strRegex = @"(?.+) (cca|ca.|ungefähr) (?[\d.,]+) (eur)?"; searchQuery = ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Me and my colleague have different versions of VisualStudio. He used interpolated string and I couldn't ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    In an application I'm developing, someone thought it would be ok idea to include commas in the values ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    In an application I'm developing, someone thought it would be ok idea to include commas in the values ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    In an application I'm developing, someone thought it would be ok idea to include commas in the values ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I need to change the status of my messages to Unseen and Seen, through telnet I have no problem ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I want create expression with reflection in c#. I am target script is: using (var service = new ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Hi Folks i was googling one more hours.i did not find anything relevant, I have text File like ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I built an OCR application which reads PDF files and OCR's them. I built it using Multi-threading ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    Designing a registration form, and I get this error when adding in MessageBoxButtons and MessageBoxIcon. The error ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    I have 2 Tables, Receipts which contains columns like Id, InvoiceId etc and Invoices, which Contains Id, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    I have 2 Tables, Receipts which contains columns like Id, InvoiceId etc and Invoices, which Contains Id, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Designing a registration form, and I get this error when adding in MessageBoxButtons and MessageBoxIcon. The error ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    F# allows constraining generic types on the type's members, similar to: type ClassWithMemberConstraint = class end ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
...