Currently I have an input box which will detect the URL and parse the data.
So right now, I am using:
var urlR = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+) (?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; var url= content.match(urlR);
The problem is, when I enter a URL like www.google.com
, its not working. when I entered http://www.google.com
, it is working.
I am not very fluent in regular expressions. Can anyone help me?
Related Posts:
- Javascript split regex question
- What is a good regular expression to match a URL? [duplicate]
- Is there a difference between /\s/g and /\s+/g?
- RegEx Ignore Case
- JavaScript replace/regex
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- Escaping Discord subset of markdown
- How to test valid UUID/GUID?
- Regular expression : match either of two conditions?
- RegExp in TypeScript
- Converting any string into camel case
- I want to remove double quotes from a String
- Regular expression for removing whitespaces
- Javascript Regular Expression Remove Spaces
- How can I extract a number from a string in JavaScript?
- Remove not alphanumeric characters from string
- Extract hostname name from string
- Difference between ?:, ?! and ?=
- Remove all special characters with RegExp
- How do you use a variable in a regular expression?
- How to count string occurrence in string?
- Regular Expression to reformat a US phone number in Javascript
- Jquery Value match Regex
- RegEx: How can I match all numbers greater than 49?
- Regular expression to validate US phone numbers?
- javascript includes() case insensitive
- RegEx for Javascript to allow only alphanumeric
- Check user logged in with JS
- How to handle Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause()
- How do I make the first letter of a string uppercase in JavaScript?
- How to format a JavaScript date
- “SyntaxError: Unexpected token < in JSON at position 0"
- How can a Discord bot create a hyperlink in a Discord message in an embed or in general? [closed]
- SyntaxError: Unexpected token o in JSON at position 1
- Uncaught ReferenceError: jQuery is not defined [duplicate]
- syntax error: unexpected token <
- How to define type for a function callback (as any function type, not universal any) used in a method parameter
- Error OPTIONS net::ERR_CONNECTION_REFUSED
- How do I test for an empty JavaScript object?
- TypeScript React.FC
confusion - Check if checkbox is checked with jQuery
- What is an unhandled promise rejection?
- How to check if array is empty or does not exist?
- How to Create simple drag and Drop in angularjs
- stop all instances of node.js server
- Working with $scope.$emit and $scope.$on
- Using Node.js require vs. ES6 import/export
- How can jQuery deferred be used?
- javascript set cookie with expire time
- Angular: conditional class with *ngClass
- How can I add a key/value pair to a JavaScript object?
- How do I change an HTML selected option using JavaScript?
- How to refresh a Page using react-route Link
- How to print a number with commas as thousands separators in JavaScript
- Convert Array to Object
- How to set the id attribute of a HTML element dynamically with angularjs (1.x)?
- Using $setValidity inside a Controller
- Combination of async function + await + setTimeout
- How can I check if a string is a valid number?
- Javascript setInterval not working
- image.onload event and browser cache
- Simulate Keypress With jQuery
- react router v^4.0.0 Uncaught TypeError: Cannot read property ‘location’ of undefined
- Why am i receiving this jsfiddle error, document.write can be a form of eval
- jquery beforeunload when closing (not leaving) the page?
- Array Mapping in AngularJs
- How do I pass the this context to a function?
- events.js: 141 throw er; // Unhandled ‘error’ event
- How to fire an event on class change using jQuery?
- JavaScript code to stop form submission
- What do these three dots in React do?
- Change an image with onclick()
- javascript return true or return false when and how to use it?
- Uncaught SyntaxError: Unexpected token with JSON.parse
- Why is this simple AngularJS ng-show not working?
- JavaScript isset() equivalent
- $http.get(…).success is not a function
- How can I convert an image into Base64 string using JavaScript?
- Is there a way to create interfaces in ES6 / Node 4?
- WordPress 5.5 – ReferenceError: commonL10n is not defined error
- How to load translation in JavaScript?
- wp_register_script multiple identifiers?
- require.js to load javascript
- Setting HTML properties in a Gutenberg plugin using WordPress settings
- customize_preview_init: listening for any changes from Customizer preview area
- Add toggle button for mobile sub-menus
- why code javascript ,not repeat the loop main wordpress
- disable tags on wordpress text editor
- How to modify the paths of js from twentytwelve theme?
- customize-controls.js – extend api.previewer
- how can i send this to wp_head – escape problem
- Add JavaScript-Library “Fitty” to WordPress
- Variations Javascript not working when product display on Quick view via ajax
- Mobile menu will only toggle on
- How can I stop loading wordpress jquery on header?
- Broken links help with site
- Change color of a specific word generated by script [closed]
- WordPress adds and tags into HTML blocks after saving
- How do i fix type error
- CCF7 Field numbuer prefilled after Click event