Regular Expression to search substring

Baurzhan

let's say I have a string like Michael is studying at the Faculty of Economics at the University

and I need to check if a given string contains the following expression: Facul* of Econom*

where the star sign implies that the word can have many different endings

In general, my goal is to find similar expressions within tables from the clickhouse database. If you suggest other options for solving this problem, I will be grateful

Peter Thoeny

If you want to match any lowercase letters following your two words use this:

\bFacul[a-z]* of Econom[a-z]*\b

If you want to match any optional letters following your two words use this:

\bFacul[A-Za-z]* of Econom[A-Za-z]*\b

Explanation:

  • \b - word boundary
  • Facul - literal text
  • [A-Za-z]* - 0 to multiple alpha chars
  • of - literal text
  • Econom - literal text
  • [A-Za-z]* - 0 to multiple alpha chars
  • \b - word boundary

If you want to be be more forgiving with upper/lowercase and spaces use this:

\b[Ff]acul[A-Za-z]* +of +[Ee]conom[A-Za-z]*\b

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Regular expression to search for Gadaffi

From Dev

Bash substring with regular expression

From Dev

POSIX regular expression to extract a substring

From Dev

Pip regular expression search

From Dev

Regular expression: Search/replace

From Dev

Write a regular expression in order to search a substring C#

From Dev

search for regular expression with the symbol '

From Dev

Maximize substring match in regular expression

From Dev

perl regular expression match substring

From Dev

Java regular expression find substring

From Dev

Using a regular expression to extract substring

From Dev

Regular expression to match specified substring to end of string?

From Dev

extract substring with regular expression

From Dev

Regular expression match multiple substring

From Dev

Regular expression to match URL substring

From Dev

Search link with regular expression

From Dev

Substring usage in MYSQL with regular expression

From Dev

Regular Expression for the search string

From Dev

Regular expression match substring

From Dev

How to substring Regular expression in JavaScript

From Dev

Ruby regular expression search

From Dev

How find substring with regular expression

From Dev

Python Regular expression to extract a substring

From Dev

a regular expression for substring or exact match

From Dev

Regular Expression Uninclusive Substring

From Dev

Regular expression for a substring from a line

From Dev

Regular expression match multiple substring

From Dev

Remove substring with Ruby regular expression

From Dev

vscode Regular expression search?