Category : regex

Beginner here, I’m trying to figure out how to validate a username to satisfy these conditions… Usernames cannot contain an ampersand (&), equals sign (=), underscore (_), apostrophe (‘), dash (-), plus sign (+), comma (,), brackets (<,>), or more than one period (.) in a row. Usernames cannot begin or end with periods (.). ..

Read more

considering a string which could be "sjhdgf" or "sjhdgf$M0" – which is the correct way to extract the optional part "$M0" if it could be behind ANY string like "sjhdgf" ? I tried with ‘#^(?<anystring>.*)($M(?<optpart>[0-5]))?#’ but that doesn’t identify the optional part. If i omit the trailing ‘?’ it fails with strings without the optional ..

Read more

I’m trying to build my regex to match my urls Here are 2 example urls category/sorganiser/bouger/escalade/offre/78934/ category/sorganiser/savourer/offre/8040/ I would like to get the number just after offre (78934 and 8040) as well as the word just before the word offre (escalade and savourer) I did several tests but did not pass ^category/(((w)+/){1,3})(d+)/?$ ^category/(((w)+/){1,3})/offre/(d+)/?$ https://regex101.com/r/S4MTvK/1 Thank ..

Read more

I’ve the next code in a string: <div class="navbar-nav navbar-right"> <span class="text-muted my-2 my-sm-0 mx-2">@lang(‘Welcome, user’, [‘user’=> $user]). {{ $login }} {!! $adminBadge !!}</span> </div> <div class="navbar-nav navbar-right"> <a href="{{ route(‘logout’) }}" class="btn btn-outline-success my-2 my-sm-0" role="button">@lang(‘menu.close_session’)</a>@lang(‘This is a very @lang("gag") complex string’) another {{ __(‘call example’) }} call </div> The question is taht I ..

Read more

I want to print out values matched by my regular expressions, however I do not need the full matched regex to be visible, only the group part. Right now it prints out something like this: 2021/04/12 14:22:10 https://v.emotionvideo.me/watch.php?vid=ElkkU3LLa data-embed='<iframe src="https://vidroba.com/embed-lm81h7j59qhk.html" The Lion King 2019 AND 2021/04/12 14:22:10 https://v.emotionvideo.me/watch.php?vid=ElkkU3LLa https://vidroba.com/embed-lm81h7j59qhk.html The Lion King 2019 I want ..

Read more

I have the following fixed pattern markup scenarios <div class="myclass" id="id123" data-foo="bar">content</div> <div class="myclass" id="id123" data-foo="bar" >content</div> <div class="myclass" id="id123" data-foo="bar" data-baz="qux">content</div> <div class="myclass" id="id123" data-foo="bar" data-baz="qux" >content</div> I’m trying to parse the following values out id123 bar qux (if it ever exists) I was able to figure out how to get the different scenarios, ..

Read more

So, the requirement for this is to match last names of people, separated by a dash between each last name. The base RegEx I am using for this is this one: (?=S*[-])([a-zA-ZÑñÁáÉéÍíÓóÚúÄäËëÏïÖöÜüÀàÈèÌìÒòÙù’-]+) Basically I am limiting it to latin alphabet characters, including some accented characters. This works perfectly fine if I use examples like: Pérez-González ..

Read more