Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8584989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:56:54+00:00 2026-06-11T21:56:54+00:00

I type as a user name v = ddd for example. I have then

  • 0

I type as a user name v = ddd for example. I have then a string, name, of this shape:

aaa.bbb.ccc.ddd.eee 

and I want to detect if in my string name there exist (between dots) such string like from my input. How can I do it?

I tried the idea with

str = 'REGEXP.helps.you.relax';
user = 'el'
[m s e] = regexp(str, '\w*user\w*', 'match', 'start', 'end')

but I get error, because cannot put the variable 'user' this way inside regexp.
How can I do it correctly? Or maybe is there any simpler idea?

Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:56:55+00:00Added an answer on June 11, 2026 at 9:56 pm

    As an alternative to regexes, you can use strfind, which finds one string inside another. It returns the starting index of the child string (if it exists) and an empty matrix vector. Since you only need to check if that string exists or not, a simple solution is:

    ~isempty(strfind(str,user))
    % ans = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three models: class User include Mongoid::Document field :name, :type => String has_many
Here's an example of what I mean: I have an array: array('type'=>'text', 'class'=>'input', 'name'=>'username',
basically i wish to achieve like user type file name,then video will be pop
Here is the JSON returned from my Server. [{description:A user,name:test,type:user}] I want to remove
I get an JSON Array like this: [{type:user,id:12,name:Name of User},{type:group,id:9,name:Name of UserGroup}] The Backend
this is privileges setting part User Host Type Privileges Grant username % database-specific ALL
I have a BindingList of type User, the User object has several properties (UserName,
User Class - Name - Picture Friend Class - Profile Of Type User -
This is the login function (after I validate user name and password, I load
I have this quick query but since my table is named User (SQL keyword),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.